[libvirt] [PATCH] qemu: monitor: Fix memory leak in qemuMonitorJSONNBDServerStart()

w00251574 posted 1 patch 5 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/a17c864f-0b25-42fb-9f9c-eed962da5fb8@HGHY1w002515742.local
Test syntax-check passed
src/qemu/qemu_monitor_json.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt] [PATCH] qemu: monitor: Fix memory leak in qemuMonitorJSONNBDServerStart()
Posted by w00251574 5 years, 10 months ago
Subject: [PATCH] qemu: monitor: Fix memory leak in qemuMonitorJSONNBDServerStart()

Exiting early through the return path did result in 'port_str'
being leaked.

Signed-off-by: Jie Wang <wangjie88.huawei.com>
---
 src/qemu/qemu_monitor_json.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index aa89ea7056..3e90279b71 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -6540,7 +6540,7 @@ qemuMonitorJSONNBDServerStart(qemuMonitorPtr mon,
         return ret;
 
     if (!(addr = qemuMonitorJSONBuildInetSocketAddress(host, port_str)))
-        return ret;
+        goto cleanup;
 
     if (!(cmd = qemuMonitorJSONMakeCommand("nbd-server-start",
                                            "a:addr", &addr,
-- 
2.15.0.windows.1




--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: monitor: Fix memory leak in qemuMonitorJSONNBDServerStart()
Posted by Michal Prívozník 5 years, 10 months ago
On 06/25/2018 03:48 PM, w00251574 wrote:
> Subject: [PATCH] qemu: monitor: Fix memory leak in qemuMonitorJSONNBDServerStart()
> 
> Exiting early through the return path did result in 'port_str'
> being leaked.
> 
> Signed-off-by: Jie Wang <wangjie88.huawei.com>
> ---
>  src/qemu/qemu_monitor_json.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

ACKed and pushed.

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: monitor: Fix memory leak in qemuMonitorJSONNBDServerStart()
Posted by Ján Tomko 5 years, 10 months ago
On Mon, Jun 25, 2018 at 07:41:54PM +0200, Michal Prívozník wrote:
>On 06/25/2018 03:48 PM, w00251574 wrote:
>> Subject: [PATCH] qemu: monitor: Fix memory leak in qemuMonitorJSONNBDServerStart()
>>
>> Exiting early through the return path did result in 'port_str'
>> being leaked.
>>
>> Signed-off-by: Jie Wang <wangjie88.huawei.com>

Please fix your user.name in git config to match the signoff name:
https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup

"w00251574" does not look like a human name.

>> ---
>>  src/qemu/qemu_monitor_json.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
>ACKed and pushed.
>

Please add 'checking the Author and Signoff' fields to your review
workflow.

Jano

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