On 3/20/20 12:57 PM, Peter Maydell wrote:
On Mon, 11 Feb 2019 at 20:57, Eric Blake <ebl...@redhat.com> wrote:

From: Andrey Shinkevich <andrey.shinkev...@virtuozzo.com>

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