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-09 10:53:22 +0100
commit3a5bd5aba23583e64bfaabc906ca95b0f9d37578 (patch)
tree52aa92aac3d92aaaf992c62bef3787bc110dff37
parent76dfb74324fa0daa343d7edf89bd05e1fe7b4db0 (diff)
downloadlibguestfs-3a5bd5aba23583e64bfaabc906ca95b0f9d37578.tar.gz
libguestfs-3a5bd5aba23583e64bfaabc906ca95b0f9d37578.tar.xz
libguestfs-3a5bd5aba23583e64bfaabc906ca95b0f9d37578.zip
Coverity: Check return value of malloc.
-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. */
}