From 03f2256f6a0b43c2221812a248614653ec333f0c Mon Sep 17 00:00:00 2001 From: Anderson Lizardo Date: Tue, 2 Apr 2013 11:07:43 -0400 Subject: [PATCH] attrib: Fix memory leak on low memory condition If g_try_new0() fails due to low memory condition, "list" should be freed before returning from primary_all_cb(). --- attrib/gatt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/attrib/gatt.c b/attrib/gatt.c index 44d3eb651..e4c538503 100644 --- a/attrib/gatt.c +++ b/attrib/gatt.c @@ -226,6 +226,7 @@ static void primary_all_cb(guint8 status, const guint8 *ipdu, guint16 iplen, primary = g_try_new0(struct gatt_primary, 1); if (!primary) { + att_data_list_free(list); err = ATT_ECODE_INSUFF_RESOURCES; goto done; } -- 2.47.3