Fix a few more issues found by Coverity.
[oweals/tinc.git] / src / xmalloc.c
index a6874332091f1685ba14f863b19ca0d286ecfc77..39dc03c7229d79d7d321781ba78283fd1ea4f59e 100644 (file)
@@ -113,9 +113,12 @@ char *xstrdup(const char *s)
 {
   char *p;
   
+  if(!s)
+    return NULL;
+
   p = strdup(s);
   if(!p)
-    xalloc_fail (s ? (int)strlen(s) : 0);
+    xalloc_fail ((int)strlen(s));
   return p;
 }