libfreerdp-utils/memory: add a pointer check in xstrdup.
authorVic Lee <llyzs@163.com>
Sun, 25 Sep 2011 03:49:09 +0000 (11:49 +0800)
committerVic Lee <llyzs@163.com>
Sun, 25 Sep 2011 03:49:09 +0000 (11:49 +0800)
libfreerdp-utils/memory.c

index f20c9d2..a3077fd 100644 (file)
@@ -105,6 +105,9 @@ char* xstrdup(const char* str)
 {
        char* mem;
 
+       if (str == NULL)
+               return NULL;
+
 #ifdef _WIN32
        mem = _strdup(str);
 #else