aboutsummaryrefslogtreecommitdiff
path: root/slirp/slirp.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2018-11-10 17:45:44 +0400
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2019-01-14 00:40:54 +0100
commitc27f247865d7e1910136b57a5c066737ab1bf2bb (patch)
tree66b26345038eeaba0511264b4d93d2226c5315e5 /slirp/slirp.c
parentb7f43bf2f6166cc6e4ee22898ae31b76503378aa (diff)
slirp: fix slirp_add_exec() leaks
Free the list elements allocated in add_exec(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'slirp/slirp.c')
-rw-r--r--slirp/slirp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/slirp/slirp.c b/slirp/slirp.c
index ab08694e37..1627436e7d 100644
--- a/slirp/slirp.c
+++ b/slirp/slirp.c
@@ -342,6 +342,14 @@ Slirp *slirp_init(int restricted, bool in_enabled, struct in_addr vnetwork,
void slirp_cleanup(Slirp *slirp)
{
+ struct ex_list *e, *next;
+
+ for (e = slirp->exec_list; e; e = next) {
+ next = e->ex_next;
+ g_free(e->ex_exec);
+ g_free(e);
+ }
+
QTAILQ_REMOVE(&slirp_instances, slirp, entry);
unregister_savevm(NULL, "slirp", slirp);