summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorMikhail Gusarov <dottedmag@dottedmag.net>2010-06-06 15:28:30 +0700
committerMikhail Gusarov <dottedmag@dottedmag.net>2010-06-06 20:27:18 +0700
commit0a4d8cbdcd7b25313fb29ccdb498044af95f7de6 (patch)
tree3534c9035180b7e0d2ebbbf0202a370cb61f8e8d /Xi
parent5a0fc0ad21d562612676ef88ef2d533b2391810a (diff)
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>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/gtmotion.c3
-rw-r--r--Xi/xiproperty.c9
2 files changed, 4 insertions, 8 deletions
diff --git a/Xi/gtmotion.c b/Xi/gtmotion.c
index 32d80eeec..9132f4f47 100644
--- a/Xi/gtmotion.c
+++ b/Xi/gtmotion.c
@@ -153,8 +153,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
}
WriteToClient(client, length * 4, (char *)coords);
}
- if (coords)
- free(coords);
+ free(coords);
return Success;
}
diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index b4d939f99..c1839aab8 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -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)
{