[libvirt] [PATCH 3/3] vmx: Free @firmware in virVMXParseConfig
Pino Toscano
ptoscano at redhat.com
Tue Apr 23 08:14:38 UTC 2019
On Tuesday, 23 April 2019 09:39:33 CEST Michal Privoznik wrote:
> The @firmware string is allocated, but never freed.
>
> 4 bytes in 1 blocks are definitely lost in loss record 1 of 44
> at 0x483579F: malloc (vg_replace_malloc.c:299)
> by 0x76FB469: strdup (strdup.c:42)
> by 0x497B6DE: virStrdup (virstring.c:966)
> by 0x48F6FD3: virConfGetValueString (virconf.c:908)
> by 0x4B3E9B6: virVMXGetConfigStringHelper (vmx.c:736)
> by 0x4B3EA6B: virVMXGetConfigString (vmx.c:756)
> by 0x4B41AEA: virVMXParseConfig (vmx.c:1832)
> by 0x10B8E4: testCompareFiles (vmx2xmltest.c:79)
> by 0x10BAB8: testCompareHelper (vmx2xmltest.c:124)
> by 0x10D058: virTestRun (testutils.c:174)
> by 0x10CDDA: mymain (vmx2xmltest.c:288)
> by 0x10F11C: virTestMain (testutils.c:1096)
>
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
> src/vmx/vmx.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
> index 35b83a2320..7bb5eb956d 100644
> --- a/src/vmx/vmx.c
> +++ b/src/vmx/vmx.c
> @@ -1861,6 +1861,7 @@ virVMXParseConfig(virVMXContext *ctx,
> VIR_FREE(sched_cpu_shares);
> VIR_FREE(guestOS);
> virCPUDefFree(cpu);
> + VIR_FREE(firmware);
>
Oops, my bad. The alternative is to make @firmware an autofree
variable, although for consistency this is better.
Reviewed-by: Pino Toscano <ptoscano at redhat.com>
--
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190423/a1e9cb82/attachment-0001.sig>
More information about the libvir-list
mailing list