qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PULL 3/4] qcow2: Add list of bitmaps to ImageInfoSpeci


From: Eric Blake
Subject: Re: [Qemu-devel] [PULL 3/4] qcow2: Add list of bitmaps to ImageInfoSpecificQCow2
Date: Fri, 20 Mar 2020 13:38:38 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

On 3/20/20 12:57 PM, Peter Maydell wrote:
On Mon, 11 Feb 2019 at 20:57, Eric Blake <address@hidden> wrote:

From: Andrey Shinkevich <address@hidden>

In the 'Format specific information' section of the 'qemu-img info'
command output, the supplemental information about existing QCOW2
bitmaps will be shown, such as a bitmap name, flags and granularity:

Hi; Coverity has just noticed an issue (CID 1421894) with this change:


+        Qcow2BitmapInfoList *bitmaps;
+        bitmaps = qcow2_get_bitmap_info_list(bs, &local_err);
+        if (local_err) {
+            error_propagate(errp, local_err);
+            qapi_free_ImageInfoSpecific(spec_info);
+            return NULL;

If we take this error-exit codepath, then we never free the
memory allocated by the earlier call to qcrypto_block_get_info().

Fix sent.

Hmm - it would be nice if the QAPI generator could declare all QAPI types as g_autoptr compatible, so we could simplify our cleanup paths to not have to worry about calling qapi_free_FOO() on all paths. But while the memory leak fix is a one-liner safe for 5.0, switching to g_autoptr is a bigger task that would be 5.1 material.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]