* [Qemu-devel] [PATCH] nvdimm: fix memory leak in error code path
@ 2016-06-28 9:06 Stefan Hajnoczi
2016-06-28 9:10 ` Igor Mammedov
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2016-06-28 9:06 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Xiao Guangrong, Igor Mammedov, Michael S. Tsirkin,
Stefan Hajnoczi
object_get_canonical_path_component() returns a heap-allocated string
that must be freed using g_free().
Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
hw/mem/nvdimm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c
index 81896c0..7895805 100644
--- a/hw/mem/nvdimm.c
+++ b/hw/mem/nvdimm.c
@@ -98,6 +98,7 @@ static void nvdimm_realize(PCDIMMDevice *dimm, Error **errp)
"small to contain nvdimm label (0x%" PRIx64 ") and "
"aligned PMEM (0x%" PRIx64 ")",
path, memory_region_size(mr), nvdimm->label_size, align);
+ g_free(path);
return;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] nvdimm: fix memory leak in error code path
2016-06-28 9:06 [Qemu-devel] [PATCH] nvdimm: fix memory leak in error code path Stefan Hajnoczi
@ 2016-06-28 9:10 ` Igor Mammedov
2016-06-28 9:20 ` Xiao Guangrong
2016-07-06 15:52 ` Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Igor Mammedov @ 2016-06-28 9:10 UTC (permalink / raw)
To: Stefan Hajnoczi
Cc: qemu-devel, Paolo Bonzini, Xiao Guangrong, Michael S. Tsirkin
On Tue, 28 Jun 2016 10:06:46 +0100
Stefan Hajnoczi <stefanha@redhat.com> wrote:
> object_get_canonical_path_component() returns a heap-allocated string
> that must be freed using g_free().
>
> Reported-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> ---
> hw/mem/nvdimm.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c
> index 81896c0..7895805 100644
> --- a/hw/mem/nvdimm.c
> +++ b/hw/mem/nvdimm.c
> @@ -98,6 +98,7 @@ static void nvdimm_realize(PCDIMMDevice *dimm, Error **errp)
> "small to contain nvdimm label (0x%" PRIx64 ") and "
> "aligned PMEM (0x%" PRIx64 ")",
> path, memory_region_size(mr), nvdimm->label_size, align);
> + g_free(path);
> return;
> }
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] nvdimm: fix memory leak in error code path
2016-06-28 9:06 [Qemu-devel] [PATCH] nvdimm: fix memory leak in error code path Stefan Hajnoczi
2016-06-28 9:10 ` Igor Mammedov
@ 2016-06-28 9:20 ` Xiao Guangrong
2016-07-06 15:52 ` Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Xiao Guangrong @ 2016-06-28 9:20 UTC (permalink / raw)
To: Stefan Hajnoczi, qemu-devel
Cc: Paolo Bonzini, Igor Mammedov, Michael S. Tsirkin
On 06/28/2016 05:06 PM, Stefan Hajnoczi wrote:
> object_get_canonical_path_component() returns a heap-allocated string
> that must be freed using g_free().
>
Reviewed-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Thanks for your fix and thank Paolo for the report.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] nvdimm: fix memory leak in error code path
2016-06-28 9:06 [Qemu-devel] [PATCH] nvdimm: fix memory leak in error code path Stefan Hajnoczi
2016-06-28 9:10 ` Igor Mammedov
2016-06-28 9:20 ` Xiao Guangrong
@ 2016-07-06 15:52 ` Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2016-07-06 15:52 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: qemu-devel, Paolo Bonzini, Xiao Guangrong, Igor Mammedov,
stefanha
[-- Attachment #1: Type: text/plain, Size: 921 bytes --]
On Tue, Jun 28, 2016 at 10:06:46AM +0100, Stefan Hajnoczi wrote:
> object_get_canonical_path_component() returns a heap-allocated string
> that must be freed using g_free().
>
> Reported-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> hw/mem/nvdimm.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c
> index 81896c0..7895805 100644
> --- a/hw/mem/nvdimm.c
> +++ b/hw/mem/nvdimm.c
> @@ -98,6 +98,7 @@ static void nvdimm_realize(PCDIMMDevice *dimm, Error **errp)
> "small to contain nvdimm label (0x%" PRIx64 ") and "
> "aligned PMEM (0x%" PRIx64 ")",
> path, memory_region_size(mr), nvdimm->label_size, align);
> + g_free(path);
> return;
> }
Michael: Please take this patch through your ACPI tree
Thanks,
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-07-06 15:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-28 9:06 [Qemu-devel] [PATCH] nvdimm: fix memory leak in error code path Stefan Hajnoczi
2016-06-28 9:10 ` Igor Mammedov
2016-06-28 9:20 ` Xiao Guangrong
2016-07-06 15:52 ` Stefan Hajnoczi
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).