* [Qemu-devel] [PATCH] Fix tiny leak in qemu_opts_parse
@ 2010-04-29 16:24 Jan Kiszka
2010-05-03 17:14 ` Anthony Liguori
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2010-04-29 16:24 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
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>
---
qemu-option.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/qemu-option.c b/qemu-option.c
index 1ffc497..076dddf 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)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix tiny leak in qemu_opts_parse
2010-04-29 16:24 [Qemu-devel] [PATCH] Fix tiny leak in qemu_opts_parse Jan Kiszka
@ 2010-05-03 17:14 ` Anthony Liguori
0 siblings, 0 replies; 2+ messages in thread
From: Anthony Liguori @ 2010-05-03 17:14 UTC (permalink / raw)
To: Jan Kiszka; +Cc: qemu-devel, Gerd Hoffmann
On 04/29/2010 11:24 AM, Jan Kiszka wrote:
> 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>
>
Applied. Thanks.
Regards,
Anthony Liguori
> ---
> qemu-option.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/qemu-option.c b/qemu-option.c
> index 1ffc497..076dddf 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)
>
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-03 17:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-29 16:24 [Qemu-devel] [PATCH] Fix tiny leak in qemu_opts_parse Jan Kiszka
2010-05-03 17:14 ` Anthony Liguori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).