All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH] vl: fix resource leak with monitor_fdset_add_fd
@ 2015-03-13 12:55 ` Paolo Bonzini
  0 siblings, 0 replies; 12+ messages in thread
From: Paolo Bonzini @ 2015-03-13 12:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, famz, zhaoshenglong

monitor_fdset_add_fd returns an AddfdInfo struct (used by the QMP
command add_fd).  Free it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
	v1->v2: line length [Fam], pass &error_abort [Shannon]
---
 vl.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/vl.c b/vl.c
index eba5d4c..9eae8f9 100644
--- a/vl.c
+++ b/vl.c
@@ -1011,6 +1011,7 @@ static int parse_add_fd(QemuOpts *opts, void *opaque)
     int fd, dupfd, flags;
     int64_t fdset_id;
     const char *fd_opaque = NULL;
+    AddfdInfo *fdinfo;
 
     fd = qemu_opt_get_number(opts, "fd", -1);
     fdset_id = qemu_opt_get_number(opts, "set", -1);
@@ -1060,8 +1061,10 @@ static int parse_add_fd(QemuOpts *opts, void *opaque)
     }
 
     /* add the duplicate fd, and optionally the opaque string, to the fd set */
-    monitor_fdset_add_fd(dupfd, true, fdset_id, fd_opaque ? true : false,
-                         fd_opaque, NULL);
+    fdinfo = monitor_fdset_add_fd(dupfd, true, fdset_id,
+                                  fd_opaque ? true : false, fd_opaque,
+                                  &error_abort);
+    g_free(fdinfo);
 
     return 0;
 }
-- 
2.3.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread
* [Qemu-trivial] [PATCH] vl: fix resource leak with monitor_fdset_add_fd
@ 2015-03-12 14:57 Paolo Bonzini
  2015-03-12 16:42 ` [Qemu-trivial] [Qemu-devel] " Eric Blake
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Paolo Bonzini @ 2015-03-12 14:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial

monitor_fdset_add_fd returns an AddfdInfo struct (used by the QMP
command add_fd).  Free it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 vl.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/vl.c b/vl.c
index eba5d4c..8902435 100644
--- a/vl.c
+++ b/vl.c
@@ -1011,6 +1011,7 @@ static int parse_add_fd(QemuOpts *opts, void *opaque)
     int fd, dupfd, flags;
     int64_t fdset_id;
     const char *fd_opaque = NULL;
+    AddfdInfo *fdinfo;
 
     fd = qemu_opt_get_number(opts, "fd", -1);
     fdset_id = qemu_opt_get_number(opts, "set", -1);
@@ -1060,8 +1061,9 @@ static int parse_add_fd(QemuOpts *opts, void *opaque)
     }
 
     /* add the duplicate fd, and optionally the opaque string, to the fd set */
-    monitor_fdset_add_fd(dupfd, true, fdset_id, fd_opaque ? true : false,
-                         fd_opaque, NULL);
+    fdinfo = monitor_fdset_add_fd(dupfd, true, fdset_id, fd_opaque ? true : false,
+                                  fd_opaque, NULL);
+    g_free(fdinfo);
 
     return 0;
 }
-- 
2.3.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-03-14  8:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-13 12:55 [Qemu-trivial] [PATCH] vl: fix resource leak with monitor_fdset_add_fd Paolo Bonzini
2015-03-13 12:55 ` [Qemu-devel] " Paolo Bonzini
2015-03-13 13:56 ` [Qemu-trivial] " Eric Blake
2015-03-13 13:56   ` Eric Blake
2015-03-14  8:08   ` [Qemu-trivial] " Markus Armbruster
2015-03-14  8:08     ` Markus Armbruster
2015-03-14  1:15 ` [Qemu-trivial] " Shannon Zhao
2015-03-14  1:15   ` [Qemu-devel] " Shannon Zhao
  -- strict thread matches above, loose matches on Subject: below --
2015-03-12 14:57 [Qemu-trivial] " Paolo Bonzini
2015-03-12 16:42 ` [Qemu-trivial] [Qemu-devel] " Eric Blake
2015-03-12 23:37 ` Fam Zheng
2015-03-13  5:17 ` Shannon Zhao
2015-03-13 12:53   ` Paolo Bonzini

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.