All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pan Nengyuan <pannengyuan@huawei.com>
To: <qemu-devel@nongnu.org>
Cc: Kevin Wolf <kwolf@redhat.com>,
	zhang.zhanghailiang@huawei.com, qemu-block@nongnu.org,
	Pan Nengyuan <pannengyuan@huawei.com>,
	Markus Armbruster <armbru@redhat.com>,
	Max Reitz <mreitz@redhat.com>,
	euler.robot@huawei.com, kuhn.chenqun@huawei.com
Subject: [PATCH v2 08/10] blockdev: Fix a memleak in drive_backup_prepare()
Date: Mon, 31 Aug 2020 09:43:13 -0400	[thread overview]
Message-ID: <20200831134315.1221-9-pannengyuan@huawei.com> (raw)
In-Reply-To: <20200831134315.1221-1-pannengyuan@huawei.com>

'local_err' seems forgot to propagate in error path, it'll cause
a memleak. Fix it.

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
---
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: qemu-block@nongnu.org
---
- V2: no changes in v2.
---
 blockdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/blockdev.c b/blockdev.c
index 3848a9c8ab..842ac289c1 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1801,6 +1801,7 @@ static void drive_backup_prepare(BlkActionState *common, Error **errp)
     if (set_backing_hd) {
         bdrv_set_backing_hd(target_bs, source, &local_err);
         if (local_err) {
+            error_propagate(errp, local_err);
             goto unref;
         }
     }
-- 
2.18.2



  parent reply	other threads:[~2020-08-31  7:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-31 13:43 [PATCH v2 00/10] fix some error memleaks Pan Nengyuan
2020-08-31 13:43 ` [PATCH v2 01/10] qga/channel-posix: Plug memory leak in ga_channel_write_all() Pan Nengyuan
2020-08-31 13:43 ` [PATCH v2 02/10] elf2dmp/qemu_elf: Plug memleak in QEMU_Elf_init Pan Nengyuan
2020-08-31 13:43 ` [PATCH v2 03/10] elf2dmp/pdb: Plug memleak in pdb_init_from_file Pan Nengyuan
2020-08-31 13:43 ` [PATCH v2 04/10] target/i386/sev: Plug memleak in sev_read_file_base64 Pan Nengyuan
2020-09-02 11:30   ` Eduardo Habkost
2020-08-31 13:43 ` [PATCH v2 05/10] ui/gtk-gl-area: Plug memleak in gd_gl_area_create_context() Pan Nengyuan
2020-08-31  8:38   ` Gerd Hoffmann
2020-08-31 13:43 ` [PATCH v2 06/10] target/i386/cpu: Fix memleak in x86_cpu_class_check_missing_features Pan Nengyuan
2020-09-01 12:03   ` Markus Armbruster
2020-09-02  0:55     ` Pan Nengyuan
2020-09-02 11:29   ` Eduardo Habkost
2020-08-31 13:43 ` [PATCH v2 07/10] migration/colo: Plug memleaks in colo_process_incoming_thread Pan Nengyuan
2020-09-01 11:14   ` Li Qiang
2020-08-31 13:43 ` Pan Nengyuan [this message]
2020-08-31 13:43 ` [PATCH v2 09/10] block/file-posix: fix a possible undefined behavior Pan Nengyuan
2020-09-01 11:15   ` Li Qiang
2020-08-31 13:43 ` [PATCH v2 10/10] vnc-auth-sasl: Plug memleak in vnc_socket_ip_addr_string Pan Nengyuan
2020-08-31  8:38   ` Gerd Hoffmann
2020-09-17 12:49 ` [PATCH v2 00/10] fix some error memleaks Pan Nengyuan
2020-09-21  2:12   ` Pan Nengyuan
2020-10-10 11:05     ` Pan Nengyuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200831134315.1221-9-pannengyuan@huawei.com \
    --to=pannengyuan@huawei.com \
    --cc=armbru@redhat.com \
    --cc=euler.robot@huawei.com \
    --cc=kuhn.chenqun@huawei.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=zhang.zhanghailiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.