[libvirt] [PATCH] qemu: agent: fix potential leak in qemuAgentGetFSInfo()

Jonathon Jongsma posted 1 patch 4 years, 7 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20190828184814.14464-1-jjongsma@redhat.com
There is a newer version of this series
src/qemu/qemu_agent.c | 1 +
1 file changed, 1 insertion(+)
[libvirt] [PATCH] qemu: agent: fix potential leak in qemuAgentGetFSInfo()
Posted by Jonathon Jongsma 4 years, 7 months ago
On error paths, info_ret could potentially leak. Make sure it's freed.
---
Thanks to John Ferlan for the catch. Apparently this got missed before the
patch was merged

 src/qemu/qemu_agent.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
index c63db968c6..a4113460bd 100644
--- a/src/qemu/qemu_agent.c
+++ b/src/qemu/qemu_agent.c
@@ -2208,6 +2208,7 @@ qemuAgentGetFSInfo(qemuAgentPtr mon,
             virDomainFSInfoFree(info_ret[i]);
     }
     VIR_FREE(agentinfo);
+    VIR_FREE(info_ret);
     return ret;
 }
 
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: agent: fix potential leak in qemuAgentGetFSInfo()
Posted by Erik Skultety 4 years, 7 months ago
On Wed, Aug 28, 2019 at 01:48:14PM -0500, Jonathon Jongsma wrote:
> On error paths, info_ret could potentially leak. Make sure it's freed.

The patch is missing your "Developer Certificate of Origin" aka Signed-off-by,
I can't merge it without it.

Otherwise:
Reviewed-by: Erik Skultety <eskultet@redhat.com>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH v2] qemu: agent: fix potential leak in qemuAgentGetFSInfo()
Posted by Jonathon Jongsma 4 years, 7 months ago
On error paths, info_ret could potentially leak. Make sure it's freed.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
---
 src/qemu/qemu_agent.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
index c63db968c6..a4113460bd 100644
--- a/src/qemu/qemu_agent.c
+++ b/src/qemu/qemu_agent.c
@@ -2208,6 +2208,7 @@ qemuAgentGetFSInfo(qemuAgentPtr mon,
             virDomainFSInfoFree(info_ret[i]);
     }
     VIR_FREE(agentinfo);
+    VIR_FREE(info_ret);
     return ret;
 }
 
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2] qemu: agent: fix potential leak in qemuAgentGetFSInfo()
Posted by Erik Skultety 4 years, 7 months ago
On Thu, Aug 29, 2019 at 08:56:29AM -0500, Jonathon Jongsma wrote:
> On error paths, info_ret could potentially leak. Make sure it's freed.
>
> Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>

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