summaryrefslogtreecommitdiff
path: root/xkb
diff options
context:
space:
mode:
authorCyril Brulebois <kibi@debian.org>2010-11-08 23:35:33 +0100
committerPeter Hutterer <peter.hutterer@who-t.net>2010-11-11 08:29:54 +1000
commitb142b0d27442191d628762604f4eb1f65263d717 (patch)
tree502f7f92f01a5ecf8301bc5bf41555934896d128 /xkb
parent0649ac0afdb3f8ed11c2634563d6b9df161cb9ec (diff)
Remove more superfluous if(p!=NULL) checks around free(p).
This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ - if (E != NULL) - free(E); + free(E); Signed-off-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xkb')
-rw-r--r--xkb/XKBMAlloc.c6
-rw-r--r--xkb/ddxLoad.c6
2 files changed, 4 insertions, 8 deletions
diff --git a/xkb/XKBMAlloc.c b/xkb/XKBMAlloc.c
index e85a8af95..2681ba3c3 100644
--- a/xkb/XKBMAlloc.c
+++ b/xkb/XKBMAlloc.c
@@ -292,11 +292,9 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys;
}
type= &xkb->map->types[type_ndx];
if (map_count==0) {
- if (type->map!=NULL)
- free(type->map);
+ free(type->map);
type->map= NULL;
- if (type->preserve!=NULL)
- free(type->preserve);
+ free(type->preserve);
type->preserve= NULL;
type->map_count= 0;
}
diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c
index 5e6ab8770..cfc6198fd 100644
--- a/xkb/ddxLoad.c
+++ b/xkb/ddxLoad.c
@@ -267,8 +267,7 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
strncpy(nameRtrn,keymap,nameRtrnLen);
nameRtrn[nameRtrnLen-1]= '\0';
}
- if (buf != NULL)
- free(buf);
+ free(buf);
return TRUE;
}
else
@@ -287,8 +286,7 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
}
if (nameRtrn)
nameRtrn[0]= '\0';
- if (buf != NULL)
- free(buf);
+ free(buf);
return FALSE;
}