aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/qemu-option.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/qemu-option.c b/util/qemu-option.c
index 19761e3eaf..834217fc75 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -75,7 +75,9 @@ const char *get_opt_value(const char *p, char **value)
size_t capacity = 0, length;
const char *offset;
- *value = NULL;
+ if (value) {
+ *value = NULL;
+ }
while (1) {
offset = qemu_strchrnul(p, ',');
length = offset - p;