aboutsummaryrefslogtreecommitdiffstats
path: root/xmalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'xmalloc.c')
-rw-r--r--xmalloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xmalloc.c b/xmalloc.c
index c5af357c..a762d0a2 100644
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -63,7 +63,8 @@ char *strdup(const char *s)
{
char *p;
p = (char *) malloc(strlen(s)+1);
- strcpy(p,s);
+ if (p)
+ strcpy(p,s);
return p;
}
#endif /* !HAVE_STRDUP */