From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O8zDm-0000nD-1d for qemu-devel@nongnu.org; Mon, 03 May 2010 13:14:18 -0400 Received: from [140.186.70.92] (port=52334 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8zDk-0000m3-FL for qemu-devel@nongnu.org; Mon, 03 May 2010 13:14:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O8zDh-0001Dw-3R for qemu-devel@nongnu.org; Mon, 03 May 2010 13:14:14 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:64031) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O8zDg-0001Ds-Qm for qemu-devel@nongnu.org; Mon, 03 May 2010 13:14:13 -0400 Received: by gyd5 with SMTP id 5so1255606gyd.4 for ; Mon, 03 May 2010 10:14:12 -0700 (PDT) Message-ID: <4BDF0458.2020700@codemonkey.ws> Date: Mon, 03 May 2010 12:14:00 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Fix tiny leak in qemu_opts_parse References: <4BD9B2CB.7060107@siemens.com> In-Reply-To: <4BD9B2CB.7060107@siemens.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 > 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) > > > >