diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2010-04-29 18:24:43 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-05-03 12:09:48 -0500 |
commit | 7966674f0ea2deab5962c9c829f1792161d3c8fb (patch) | |
tree | 0aff273089e54a6ab717ebc85bc4e315a3c42490 /qemu-option.c | |
parent | 1cc7acb31d6e1077fc1d012ee7ec117bfd6f3be4 (diff) | |
download | qemu-7966674f0ea2deab5962c9c829f1792161d3c8fb.tar.gz qemu-7966674f0ea2deab5962c9c829f1792161d3c8fb.tar.bz2 qemu-7966674f0ea2deab5962c9c829f1792161d3c8fb.zip |
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 <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-option.c')
-rw-r--r-- | qemu-option.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qemu-option.c b/qemu-option.c index 1ffc497828..076dddfc02 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) |