[PATCH 12/15] xkb: Fix allocation check to compare correct variable

Pauli Nieminen ext-pauli.nieminen at nokia.com
Tue Jul 27 05:09:53 PDT 2010


prop->name is allocated in code but check is for parameter name that
can't be NULL.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
---
 xkb/XKBGAlloc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xkb/XKBGAlloc.c b/xkb/XKBGAlloc.c
index d1adea3..7143e7a 100644
--- a/xkb/XKBGAlloc.c
+++ b/xkb/XKBGAlloc.c
@@ -669,7 +669,7 @@ 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);
-- 
1.6.3.3



More information about the xorg-devel mailing list