summaryrefslogtreecommitdiff
path: root/xkb/XKBGAlloc.c
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2010-06-10 04:08:54 +0700
committerMikhail Gusarov <dottedmag@dottedmag.net>2010-06-11 19:05:46 +0700
commitf4190feb25ecc3d8278decc8bf28a5ef0e568942 (patch)
tree1bda33d8d65126f4a7d2a53f6efdb69e4a426e1d /xkb/XKBGAlloc.c
parent89bd05106e5823fc5cfca9abf082729f2444363b (diff)
Remove more superfluous if(p) checks around free(p)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Diffstat (limited to 'xkb/XKBGAlloc.c')
-rw-r--r--xkb/XKBGAlloc.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/xkb/XKBGAlloc.c b/xkb/XKBGAlloc.c
index 796931cf4..d1adea34e 100644
--- a/xkb/XKBGAlloc.c
+++ b/xkb/XKBGAlloc.c
@@ -114,10 +114,8 @@ register char *ptr;
}
if (freeAll) {
(*num_inout)= (*sz_inout)= 0;
- if (*elems) {
- free(*elems);
- *elems= NULL;
- }
+ free(*elems);
+ *elems = NULL;
}
else if (first+count>=(*num_inout))
*num_inout= first;
@@ -137,14 +135,10 @@ _XkbClearProperty(char *prop_in)
{
XkbPropertyPtr prop= (XkbPropertyPtr)prop_in;
- if (prop->name) {
- free(prop->name);
- prop->name= NULL;
- }
- if (prop->value) {
- free(prop->value);
- prop->value= NULL;
- }
+ free(prop->name);
+ prop->name = NULL;
+ free(prop->value);
+ prop->value = NULL;
return;
}