aboutsummaryrefslogtreecommitdiffstats
path: root/extras/mini-os/xenbus
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-12-14 09:51:07 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-12-14 09:51:07 +0000
commit453414b284599a93944cc893b11f85028c1d7f76 (patch)
tree7c104656495f75b805518c7e0fbac4aabfa9c57f /extras/mini-os/xenbus
parent82b68fcd0ab980313dc739d2974d2194f83f07f1 (diff)
downloadxen-453414b284599a93944cc893b11f85028c1d7f76.tar.gz
xen-453414b284599a93944cc893b11f85028c1d7f76.tar.bz2
xen-453414b284599a93944cc893b11f85028c1d7f76.zip
mini-os: Fix memory leaks in blkfront, netfront, pcifront, etc.
The return value of Xenbus routines xenbus_transaction_start(), xenbus_printf(), xenbus_transaction_end(), etc. is a pointer of error message. This pointer should be passed to free() to release the allocated memory when it is no longer needed. Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
Diffstat (limited to 'extras/mini-os/xenbus')
-rw-r--r--extras/mini-os/xenbus/xenbus.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/extras/mini-os/xenbus/xenbus.c b/extras/mini-os/xenbus/xenbus.c
index c4e6abd8a4..22f109fd07 100644
--- a/extras/mini-os/xenbus/xenbus.c
+++ b/extras/mini-os/xenbus/xenbus.c
@@ -135,7 +135,8 @@ char *xenbus_switch_state(xenbus_transaction_t xbt, const char* path, XenbusStat
do {
if (xbt == XBT_NIL) {
- xenbus_transaction_start(&xbt);
+ msg = xenbus_transaction_start(&xbt);
+ if (msg) goto exit;
xbt_flag = 1;
}