summaryrefslogtreecommitdiffstats
path: root/daemon/lvm.c
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2009-04-30 13:36:26 +0100
committerRichard Jones <rjones@redhat.com>2009-04-30 13:36:26 +0100
commit6f5c3984a7ddfc111287e2ec214ba823db737db4 (patch)
tree688ed478d85c35729aaba4e2ef5d8d1b42271bc3 /daemon/lvm.c
parent4f7cc37e5f4a209773062d67e5f61a81f7800fc8 (diff)
downloadlibguestfs-6f5c3984a7ddfc111287e2ec214ba823db737db4.tar.gz
libguestfs-6f5c3984a7ddfc111287e2ec214ba823db737db4.tar.xz
libguestfs-6f5c3984a7ddfc111287e2ec214ba823db737db4.zip
Fix unchecked malloc (Jim Meyering).
Diffstat (limited to 'daemon/lvm.c')
-rw-r--r--daemon/lvm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/daemon/lvm.c b/daemon/lvm.c
index 6946d584..326b5830 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;