summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-02-13 21:36:04 -0800
committerPeter Hutterer <peter.hutterer@who-t.net>2011-02-15 10:35:43 +1000
commit682865c460945e1299f943561140f46439e2b4cb (patch)
tree9ce8beab55d77009691d16847018637ff1f44547
parentaac1b435664819008989ed19f73e9c89920602c5 (diff)
XkbAddGeomProperty: Fix checks for malloc failure
Check the variable we just tried to malloc, not the string we're copying and already checked for NULL at the beginning of the function. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
-rw-r--r--xkb/XKBGAlloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xkb/XKBGAlloc.c b/xkb/XKBGAlloc.c
index 3ec9edab8..f49aead02 100644
--- a/xkb/XKBGAlloc.c
+++ b/xkb/XKBGAlloc.c
@@ -659,11 +659,11 @@ register XkbPropertyPtr prop;
}
prop= &geom->properties[geom->num_properties];
prop->name= malloc(strlen(name)+1);
- if (!name)
+ if (!prop->name)
return NULL;
strcpy(prop->name,name);
prop->value= malloc(strlen(value)+1);
- if (!value) {
+ if (!prop->value) {
free(prop->name);
prop->name= NULL;
return NULL;