Coverity: Check return value of malloc.

This commit is contained in:
Richard W.M. Jones
2011-06-08 22:07:36 +01:00
parent 76dfb74324
commit 3a5bd5aba2

View File

@@ -40,6 +40,10 @@ do_glob_expand (const char *pattern)
char **rv;
rv = malloc (sizeof (char *) * 1);
if (rv == NULL) {
reply_with_perror ("malloc");
return NULL;
}
rv[0] = NULL;
return rv; /* Caller frees. */
}