Received: from eggs.gnu.org ([208.118.235.92]:51256) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvpPX-0001RU-3V for qemu-devel@nongnu.org; Thu, 17 Jan 2013 08:21:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvpPV-0007sA-Rh for qemu-devel@nongnu.org; Thu, 17 Jan 2013 08:21:39 -0500 From: Markus Armbruster References: <1358357540-29862-1-git-send-email-armbru@redhat.com> <1358357540-29862-4-git-send-email-armbru@redhat.com> <20130117111951.GH2586@stefanha-thinkpad.redhat.com> Date: Thu, 17 Jan 2013 14:21:33 +0100 In-Reply-To: <20130117111951.GH2586@stefanha-thinkpad.redhat.com> (Stefan Hajnoczi's message of "Thu, 17 Jan 2013 12:19:51 +0100") Message-ID: <87fw20rllu.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 03/11] hw/9pfs: Fix unchecked strdup() by converting to g_strdup() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org Stefan Hajnoczi writes: > On Wed, Jan 16, 2013 at 06:32:12PM +0100, Markus Armbruster wrote: >> diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c >> index 6eab7f7..74155fb 100644 >> --- a/hw/9pfs/virtio-9p-device.c >> +++ b/hw/9pfs/virtio-9p-device.c >> @@ -94,7 +94,7 @@ VirtIODevice *virtio_9p_init(DeviceState *dev, V9fsConf *conf) >> exit(1); >> } >> >> - s->tag = strdup(conf->tag); >> + s->tag = g_strdup(conf->tag); >> s->ctx.uid = -1; >> >> s->ops = fse->ops; > > s->tag is leaked. Want to send a follow-up patch to g_free() it? I'll give it a try.