summaryrefslogtreecommitdiff
path: root/xwrap.c
diff options
context:
space:
mode:
Diffstat (limited to 'xwrap.c')
-rw-r--r--xwrap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/xwrap.c b/xwrap.c
index fe158f5..e2db116 100644
--- a/xwrap.c
+++ b/xwrap.c
@@ -17,7 +17,11 @@ char *xstrdup(const char *s)
{
int len;
+ if (s == NULL)
+ return NULL;
+
len = strlen(s) + 1;
+
return memcpy(xmalloc(len), s, len);
}