Coverity: Check return value of malloc.
authorRichard W.M. Jones <rjones@redhat.com>
Wed, 8 Jun 2011 21:07:36 +0000 (22:07 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Thu, 9 Jun 2011 09:53:22 +0000 (10:53 +0100)
daemon/glob.c

index e94e4aa..f2815ec 100644 (file)
@@ -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. */
   }