xkbcomp: Back out strdup warning cleanup
authorDan Nicholson <dbn.lists@gmail.com>
Sat, 4 Apr 2009 03:33:01 +0000 (20:33 -0700)
committerDan Nicholson <dbn.lists@gmail.com>
Sat, 4 Apr 2009 03:34:19 +0000 (20:34 -0700)
There are some spots in the code that use strdup without checking the
argument, so we need this to not segfault. Cleanup later...

src/xkbcomp/utils.h

index acf6e14..f25f3e5 100644 (file)
@@ -175,7 +175,7 @@ extern int
 uStrCasePrefix(const char *p, char *str);
 #endif
 #ifdef HAVE_STRDUP
-#define        uStringDup(s1)          (strdup(s1))
+#define        uStringDup(s1)          ((s1) ? strdup(s1) : NULL)
 #else
 extern char *
 uStringDup(const char *s);