[libvirt] [PATCH] Resolve valgrind error

Guannan Ren gren at redhat.com
Wed Mar 6 14:21:19 UTC 2013


On 03/06/2013 09:49 PM, John Ferlan wrote:
> Resolves the following valgrind error from qemuxml2argvtest:
>
> ==20393== 5 bytes in 1 blocks are definitely lost in loss record 2 of 60
> ==20393==    at 0x4A0883C: malloc (vg_replace_malloc.c:270)
> ==20393==    by 0x38D690A167: __vasprintf_chk (in /usr/lib64/libc-2.16.so)
> ==20393==    by 0x4CB0D97: virVasprintf (stdio2.h:210)
> ==20393==    by 0x4CB0E53: virAsprintf (virutil.c:2017)
> ==20393==    by 0x428DC5: qemuAssignDeviceAliases (qemu_command.c:791)
> ==20393==    by 0x41DF93: testCompareXMLToArgvHelper (qemuxml2argvtest.c:151)
> ==20393==    by 0x41F53F: virtTestRun (testutils.c:157)
> ==20393==    by 0x41DA9B: mymain (qemuxml2argvtest.c:885)
> ==20393==    by 0x41FB7A: virtTestMain (testutils.c:719)
> ==20393==    by 0x38D6821A04: (below main) (in /usr/lib64/libc-2.16.so)
> ==20393==
>
> >From qemu_command.c/line 791:
>
>      if (def->rng) {
>          if (virAsprintf(&def->rng->info.alias, "rng%d", 0) < 0)
>              goto no_memory;
>      }
> ---
>   src/conf/domain_conf.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index f7c8af1..739bd72 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -13760,6 +13760,7 @@ virDomainRNGDefFree(virDomainRNGDefPtr def)
>           break;
>       }
>   
> +    virDomainDeviceInfoClear(&def->info);
>       VIR_FREE(def);
>   }
>   

     ACK

     Guannan





More information about the libvir-list mailing list