From 8c8cc51b1866b250db9add8375413c232fda973b Mon Sep 17 00:00:00 2001 From: Anderson Lizardo Date: Tue, 2 Apr 2013 11:07:45 -0400 Subject: [PATCH] attrib: Fix status on memory allocation failure If memory allocation fails, ATT_ECODE_INSUFF_RESOURCES should be reported to the callback. --- attrib/gatt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/attrib/gatt.c b/attrib/gatt.c index c1aa0702a..38d455a62 100644 --- a/attrib/gatt.c +++ b/attrib/gatt.c @@ -651,8 +651,10 @@ static void read_char_helper(guint8 status, const guint8 *rpdu, goto done; long_read->buffer = g_malloc(rlen); - if (long_read->buffer == NULL) + if (long_read->buffer == NULL) { + status = ATT_ECODE_INSUFF_RESOURCES; goto done; + } memcpy(long_read->buffer, rpdu, rlen); long_read->size = rlen; -- 2.47.3