From: Jan Kiszka Date: Thu, 29 Apr 2010 16:24:43 +0000 (+0200) Subject: Fix tiny leak in qemu_opts_parse X-Git-Tag: v0.13.0-rc0~633 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d510c5cf343eabd4d3a301f5730af724747b7055;p=thirdparty%2Fqemu.git Fix tiny leak in qemu_opts_parse 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 Signed-off-by: Anthony Liguori --- diff --git a/qemu-option.c b/qemu-option.c index 1ffc4978286..076dddfc026 100644 --- a/qemu-option.c +++ b/qemu-option.c @@ -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)