summaryrefslogtreecommitdiffstats
path: root/src/launch.c
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-09-21 12:42:53 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-09-21 12:57:11 +0100
commit1b364d74a8d42c956abdf4c5dbbc56cf1e250033 (patch)
tree7b4a3b54dfe16f180148fbfa2fc80ba7f8033ca2 /src/launch.c
parent763ec36cf0c6ffa6d359b65ff7f1ee9ab1c7361e (diff)
downloadlibguestfs-1b364d74a8d42c956abdf4c5dbbc56cf1e250033.tar.gz
libguestfs-1b364d74a8d42c956abdf4c5dbbc56cf1e250033.tar.xz
libguestfs-1b364d74a8d42c956abdf4c5dbbc56cf1e250033.zip
launch: Handle guestfs_config qemu_value == NULL.
The second parameter to 'config' may be NULL. In commit 52fa23d74f6308daf804c2330b0b27e0b4412594 (refactoring of guestfs_config) the code this got lost, and guestfs_config would segfault if qemu_value was NULL. Also this fixes the libvirt method to handle the same case. I checked libguestfs-1.18 and -1.16 branches, and this problem does NOT affect them.
Diffstat (limited to 'src/launch.c')
-rw-r--r--src/launch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/launch.c b/src/launch.c
index 7ca6fe11..a0d6c121 100644
--- a/src/launch.c
+++ b/src/launch.c
@@ -320,7 +320,7 @@ guestfs__config (guestfs_h *g,
qp = safe_malloc (g, sizeof *qp);
qp->qemu_param = safe_strdup (g, qemu_param);
- qp->qemu_value = safe_strdup (g, qemu_value);
+ qp->qemu_value = qemu_value ? safe_strdup (g, qemu_value) : NULL;
qp->next = g->qemu_params;
g->qemu_params = qp;