Commit c14c60bb37c0e82e92465eb29179bd95e6585c7b

Dan Nicholson 2009-04-03T20:33:01

xkbcomp: Back out strdup warning cleanup There are some spots in the code that use strdup without checking the argument, so we need this to not segfault. Cleanup later...

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/xkbcomp/utils.h b/src/xkbcomp/utils.h
index acf6e14..f25f3e5 100644
--- a/src/xkbcomp/utils.h
+++ b/src/xkbcomp/utils.h
@@ -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);