From: cheoleun moon Date: Mon, 19 Feb 2024 11:04:42 +0000 (+0900) Subject: Check the return value of calloc X-Git-Tag: accepted/tizen/unified/20240220.144635^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F79%2F306279%2F1;p=platform%2Fcore%2Fapi%2Fvine.git Check the return value of calloc Change-Id: Ib4c76e2c577f4c0f43ca7a0e0d119a0b9fdf6773 --- diff --git a/tool/tool_run.cpp b/tool/tool_run.cpp index f003adf..4b95eaf 100755 --- a/tool/tool_run.cpp +++ b/tool/tool_run.cpp @@ -388,6 +388,10 @@ static int _send_message_from_file(vine_dp_h dp) return -1; } buf = (unsigned char *)calloc(sizeof(unsigned char), size); + if (buf == NULL) { + fclose(file); + return -1; + } fseek(file, 0, SEEK_SET); count = fread(buf, sizeof(unsigned char), size, file);