summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-06-08 22:07:36 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-06-13 14:10:32 +0100
commita583906233e8e321dd1462e356e34de9c0697aef (patch)
tree65fa84a9abd442b60ca91af7992e6b4dbd70a661
parent6cdd349e6964636c2b7ae71453dca33716dda486 (diff)
downloadlibguestfs-a583906233e8e321dd1462e356e34de9c0697aef.tar.gz
libguestfs-a583906233e8e321dd1462e356e34de9c0697aef.tar.xz
libguestfs-a583906233e8e321dd1462e356e34de9c0697aef.zip
Coverity: Check return value of malloc.
(cherry picked from commit 3a5bd5aba23583e64bfaabc906ca95b0f9d37578)
-rw-r--r--daemon/glob.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/daemon/glob.c b/daemon/glob.c
index e94e4aa7..f2815ecc 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. */
}