summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/sdp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sdp.c b/lib/sdp.c
index 22058bd2..83ad4e2c 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
@@ -3060,11 +3060,14 @@ static void extract_record_handle_seq(uint8_t *pdu, int bufsize, sdp_list_t **se
int n;
for (n = 0; n < count; n++) {
+ uint32_t *pSvcRec;
if (bufsize < sizeof(uint32_t)) {
SDPERR("Unexpected end of packet");
break;
}
- uint32_t *pSvcRec = malloc(sizeof(uint32_t));
+ pSvcRec = malloc(sizeof(uint32_t));
+ if (!pSvcRec)
+ break;
*pSvcRec = ntohl(bt_get_unaligned((uint32_t *) pdata));
pSeq = sdp_list_append(pSeq, pSvcRec);
pdata += sizeof(uint32_t);