]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Fix tiny leak in qemu_opts_parse
authorJan Kiszka <jan.kiszka@siemens.com>
Thu, 29 Apr 2010 16:24:43 +0000 (18:24 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 3 May 2010 17:09:48 +0000 (12:09 -0500)
qemu_opts_create duplicates the id we pass in case it shall be stored in
the opts. So we do not need to dup it in qemu_opts_parse, leaking a few
bytes this way.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-option.c

index 1ffc4978286937930246262b1b847461ceb2a0c3..076dddfc026c02bc3eb40b826c9b0222f0d872a4 100644 (file)
@@ -763,10 +763,10 @@ QemuOpts *qemu_opts_parse(QemuOptsList *list, const char *params,
 
     if (strncmp(params, "id=", 3) == 0) {
         get_opt_value(value, sizeof(value), params+3);
-        id = qemu_strdup(value);
+        id = value;
     } else if ((p = strstr(params, ",id=")) != NULL) {
         get_opt_value(value, sizeof(value), p+4);
-        id = qemu_strdup(value);
+        id = value;
     }
     opts = qemu_opts_create(list, id, 1);
     if (opts == NULL)