summaryrefslogtreecommitdiff
path: root/slirp/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'slirp/misc.c')
-rw-r--r--slirp/misc.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/slirp/misc.c b/slirp/misc.c
index 260187b6b6..1940a8a75f 100644
--- a/slirp/misc.c
+++ b/slirp/misc.c
@@ -59,6 +59,21 @@ int add_exec(struct ex_list **ex_ptr, int do_pty, char *exec,
return 0;
}
+void slirp_destroy_exec_list(struct ex_list *exec_list)
+{
+ struct ex_list *item = exec_list;
+ struct ex_list *next;
+
+ while (item) {
+ next = item->ex_next;
+ if (item->ex_pty == 0) {
+ /* free command only. */
+ g_free((void *)item->ex_exec);
+ }
+ g_free(item);
+ item = next;
+ }
+}
#ifdef _WIN32