From 79803ddc3c73ee3a73cdd6e478d7e52c39fd3803 Mon Sep 17 00:00:00 2001 From: "roger.luo" Date: Fri, 24 Nov 2023 21:43:37 +0800 Subject: [PATCH] Fixed the issue where the pointer was not checked to be empty after the creation of urcbuf. --- src/at_chat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/at_chat.c b/src/at_chat.c index 95f3bdb..dc4ff0c 100644 --- a/src/at_chat.c +++ b/src/at_chat.c @@ -851,7 +851,7 @@ at_obj_t *at_obj_create(const at_adapter_t *adap) if (adap->urc_bufsize != 0) { ai->urc_bufsize = adap->urc_bufsize < 32 ? 32 : adap->urc_bufsize; ai->urcbuf = at_core_malloc(ai->urc_bufsize); - if (ai->recvbuf == NULL) { + if (ai->urcbuf == NULL) { at_obj_destroy(&ai->obj); return NULL; }