Re: [PATCH 2/4] Resolve valgrind error in virStorageBackendCreateQemuImgCmd()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/28/2013 03:25 PM, John Ferlan wrote:
> Commit id '53d5967c' introduced the following:
>
> TEST: storagevolxml2argvtest
>       ..............                           14  OK
> ==25636== 358 (264 direct, 94 indirect) bytes in 1 blocks are definitely lost in loss record 67 of 75
> ==25636==    at 0x4A06B6F: calloc (vg_replace_malloc.c:593)
> ==25636==    by 0x4C95791: virAlloc (viralloc.c:124)
> ==25636==    by 0x4CA0BB4: virCommandNewArgs (vircommand.c:805)
> ==25636==    by 0x4CA0C88: virCommandNew (vircommand.c:789)
> ==25636==    by 0x408602: virStorageBackendCreateQemuImgCmd (storage_backend.c:849)
> ==25636==    by 0x405427: testCompareXMLToArgvHelper (storagevolxml2argvtest.c:61)
> ==25636==    by 0x4064DF: virtTestRun (testutils.c:158)
> ==25636==    by 0x40516F: mymain (storagevolxml2argvtest.c:195)
> ==25636==    by 0x406B1A: virtTestMain (testutils.c:722)
> ==25636==    by 0x37C1021A04: (below main) (libc-start.c:225)
> ==25636==
> PASS: storagevolxml2argvtest
> ---
>  src/storage/storage_backend.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
> index ae25c89..9a3bcf8 100644
> --- a/src/storage/storage_backend.c
> +++ b/src/storage/storage_backend.c
> @@ -865,8 +865,10 @@ virStorageBackendCreateQemuImgCmd(virConnectPtr conn,
>                                                 do_encryption, preallocate,
>                                                 vol->target.format,
>                                                 vol->target.compat,
> -                                               vol->target.features) < 0)
> +                                               vol->target.features) < 0) {
> +            virCommandFree(cmd);
>              return NULL;
> +        }
>          if (opts)
>              virCommandAddArgList(cmd, "-o", opts, NULL);
>          VIR_FREE(opts);

ACK.

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]