From: Richard W.M. Jones Date: Wed, 8 Jun 2011 21:07:36 +0000 (+0100) Subject: Coverity: Check return value of malloc. X-Git-Tag: 1.8.8~9 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=a583906233e8e321dd1462e356e34de9c0697aef;p=libguestfs.git Coverity: Check return value of malloc. (cherry picked from commit 3a5bd5aba23583e64bfaabc906ca95b0f9d37578) --- diff --git a/daemon/glob.c b/daemon/glob.c index e94e4aa..f2815ec 100644 --- a/daemon/glob.c +++ b/daemon/glob.c @@ -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. */ }