-check malloc rval

This commit is contained in:
Christian Grothoff
2014-12-20 00:55:21 +00:00
parent eb31c3c9ba
commit 599ccf8fb5
+2
View File
@@ -149,6 +149,8 @@ static char* strcopy(const char *s, size_t len)
{
char *dst;
dst = malloc(len+1);
if (NULL == dst)
abort ();
memcpy(dst, s, len);
dst[len] = '\0';
return dst;