[lttng-dev] [PATCH lttng-tools] Fix: Memory leaks on unknown hashtable type error handling

Christian Babeux christian.babeux at efficios.com
Thu Feb 28 15:48:27 EST 2013


Signed-off-by: Christian Babeux <christian.babeux at efficios.com>
---
 src/common/hashtable/hashtable.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/common/hashtable/hashtable.c b/src/common/hashtable/hashtable.c
index 24d5797..5bf85e5 100644
--- a/src/common/hashtable/hashtable.c
+++ b/src/common/hashtable/hashtable.c
@@ -90,6 +90,7 @@ struct lttng_ht *lttng_ht_new(unsigned long size, int type)
 		break;
 	default:
 		ERR("Unknown lttng hashtable type %d", type);
+		lttng_ht_destroy(ht);
 		goto error;
 	}
 
-- 
1.8.1.3




More information about the lttng-dev mailing list