aboutsummaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
authorMatthew Daley <mattjd@gmail.com>2013-09-18 15:38:03 +1200
committerIan Campbell <ian.campbell@citrix.com>2013-09-21 16:43:04 +0100
commit6ea48409238672ed1e08cf8fa2cc8593e36a363a (patch)
tree48aaf4e327d8c22912af26046d0e8bd5114b8045 /extras
parentc2849d8fabab965973e23ac23fd28afd2873bac8 (diff)
downloadxen-6ea48409238672ed1e08cf8fa2cc8593e36a363a.tar.gz
xen-6ea48409238672ed1e08cf8fa2cc8593e36a363a.tar.bz2
xen-6ea48409238672ed1e08cf8fa2cc8593e36a363a.zip
mini-os: fix various memory leaks in various locations
Coverity-ID: 1055827 Coverity-ID: 1055828 Coverity-ID: 1055829 Coverity-ID: 1055830 Coverity-ID: 1055831 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'extras')
-rw-r--r--extras/mini-os/kernel.c7
-rw-r--r--extras/mini-os/lib/xs.c2
2 files changed, 7 insertions, 2 deletions
diff --git a/extras/mini-os/kernel.c b/extras/mini-os/kernel.c
index e9402b911d..24fa25c3ed 100644
--- a/extras/mini-os/kernel.c
+++ b/extras/mini-os/kernel.c
@@ -84,8 +84,10 @@ static void shutdown_thread(void *p)
free(err);
xenbus_wait_for_watch(&events);
}
- xenbus_unwatch_path_token(XBT_NIL, path, token);
- xenbus_write(XBT_NIL, path, "");
+ err = xenbus_unwatch_path_token(XBT_NIL, path, token);
+ if (err) free(err);
+ err = xenbus_write(XBT_NIL, path, "");
+ if (err) free(err);
printk("Shutting down (%s)\n", shutdown);
if (!strcmp(shutdown, "poweroff"))
@@ -96,6 +98,7 @@ static void shutdown_thread(void *p)
/* Unknown */
shutdown_reason = SHUTDOWN_crash;
app_shutdown(shutdown_reason);
+ free(shutdown);
}
#endif
diff --git a/extras/mini-os/lib/xs.c b/extras/mini-os/lib/xs.c
index c603d178bf..324bd05d32 100644
--- a/extras/mini-os/lib/xs.c
+++ b/extras/mini-os/lib/xs.c
@@ -144,6 +144,7 @@ char **xs_directory(struct xs_handle *h, xs_transaction_t t,
msg = xenbus_ls(t, path, &res);
if (msg) {
printk("xs_directory(%s): %s\n", path, msg);
+ free(msg);
return NULL;
}
@@ -163,6 +164,7 @@ char **xs_directory(struct xs_handle *h, xs_transaction_t t,
}
*num = n;
+ free(res);
return entries;
}