mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
Coverity: Check return value of malloc.
This commit is contained in:
@@ -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. */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user