From 453414b284599a93944cc893b11f85028c1d7f76 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Mon, 14 Dec 2009 09:51:07 +0000 Subject: 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 --- extras/mini-os/xenbus/xenbus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'extras/mini-os/xenbus') 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; } -- cgit v1.2.3