mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-30 21:53:25 +00:00
Remove more superfluous if(p) checks around free(p)
This patch has been generated by the following Coccinelle semantic patch:
@@
expression E;
@@
-if(E) { free(E); }
+free(E);
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
5a0fc0ad21
commit
0a4d8cbdcd
84 changed files with 240 additions and 412 deletions
|
|
@ -153,8 +153,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
|
|||
}
|
||||
WriteToClient(client, length * 4, (char *)coords);
|
||||
}
|
||||
if (coords)
|
||||
free(coords);
|
||||
free(coords);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -622,8 +622,7 @@ XIFetchDeviceProperty(DeviceIntPtr dev, Atom property)
|
|||
static void
|
||||
XIDestroyDeviceProperty (XIPropertyPtr prop)
|
||||
{
|
||||
if (prop->value.data)
|
||||
free(prop->value.data);
|
||||
free(prop->value.data);
|
||||
free(prop);
|
||||
}
|
||||
|
||||
|
|
@ -798,8 +797,7 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
|
|||
&new_value, checkonly);
|
||||
if (checkonly && rc != Success)
|
||||
{
|
||||
if (new_value.data)
|
||||
free(new_value.data);
|
||||
free(new_value.data);
|
||||
return (rc);
|
||||
}
|
||||
}
|
||||
|
|
@ -808,8 +806,7 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
|
|||
checkonly = !checkonly;
|
||||
} while (!checkonly);
|
||||
}
|
||||
if (prop_value->data)
|
||||
free(prop_value->data);
|
||||
free(prop_value->data);
|
||||
*prop_value = new_value;
|
||||
} else if (len == 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue