X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fglob.c;h=f2815ecc963364f1c877947a55cb1a7de4251bb7;hb=635af5be04265f845186b40e9a9fe7b102ad6909;hp=4fe76f3f051a80e15091bc418d1db30c74d2ddde;hpb=84fc760439e82e6b3616abd0d1f9bd7d7eb01ec0;p=libguestfs.git diff --git a/daemon/glob.c b/daemon/glob.c index 4fe76f3..f2815ec 100644 --- a/daemon/glob.c +++ b/daemon/glob.c @@ -40,13 +40,17 @@ 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. */ } if (r != 0) { if (errno != 0) - reply_with_perror ("glob: %s", pattern); + reply_with_perror ("%s", pattern); else reply_with_error ("glob failed: %s", pattern); return NULL;