From: Richard Jones Date: Thu, 30 Apr 2009 12:36:26 +0000 (+0100) Subject: Fix unchecked malloc (Jim Meyering). X-Git-Tag: 1.0.16~19 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=6f5c3984a7ddfc111287e2ec214ba823db737db4;p=libguestfs.git Fix unchecked malloc (Jim Meyering). --- diff --git a/daemon/lvm.c b/daemon/lvm.c index 6946d58..326b583 100644 --- a/daemon/lvm.c +++ b/daemon/lvm.c @@ -197,6 +197,10 @@ do_vgcreate (const char *volgroup, char * const* const physvols) argc = count_strings (physvols) + 3; argv = malloc (sizeof (char *) * (argc + 1)); + if (argv == NULL) { + reply_with_perror ("malloc"); + return -1; + } argv[0] = "/sbin/lvm"; argv[1] = "vgcreate"; argv[2] = volgroup;