From 7deb99b9992574ef636d47c58018bd6c9ed4c2ba Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 18 Mar 2019 20:35:03 +0100 Subject: [PATCH] realloc check? --- client/cmdflashmem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/cmdflashmem.c b/client/cmdflashmem.c index c75fadb3c..af8584ce7 100644 --- a/client/cmdflashmem.c +++ b/client/cmdflashmem.c @@ -261,6 +261,9 @@ int CmdFlashMemLoad(const char *Cmd) { } data = realloc(data, datalen); + if (!data) { + return 1; + } //Send to device uint32_t bytes_sent = 0;