summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@redhat.com>2008-09-10 17:48:29 +0930
committerPeter Hutterer <peter.hutterer@redhat.com>2008-09-11 00:31:34 +0930
commit82cebb165b22d5409c9d4d31554a8da0c867e0d3 (patch)
treeb0dd708e636dec598bd3263119165f6b92ea1a65
parenta82e1dcc8ad095581402d05e5d1ae1bbf3646954 (diff)
Check for NULL strings before calling strdup.
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
-rw-r--r--utils.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/utils.h b/utils.h
index 7e277c8..e773dea 100644
--- a/utils.h
+++ b/utils.h
@@ -237,7 +237,7 @@ uInformation(const char * /* s */ , ...
);
#endif
#ifdef HAVE_STRDUP
-#define uStringDup(s1) (strdup(s1))
+#define uStringDup(s1) ((s1) ? strdup(s1) : NULL)
#else
extern char *uStringDup(const char * /* s1 */
);