From: Jihoon Jung Date: Fri, 28 Aug 2020 06:29:53 +0000 (+0900) Subject: Fix Svace issue : #446374 X-Git-Tag: accepted/tizen/unified/20200831.002529^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F93%2F242593%2F3;p=platform%2Fcore%2Fapi%2Fuwb.git Fix Svace issue : #446374 Change-Id: Ie0bac818fb3591d54e2d360c95022dd8a695b7a2 Signed-off-by: Jihoon Jung --- diff --git a/src/uwb.c b/src/uwb.c index adf2530..df50551 100755 --- a/src/uwb.c +++ b/src/uwb.c @@ -80,10 +80,15 @@ static void __message_received(GObject *source_object, unsigned char *buf = NULL; int size = 0; + buf = (unsigned char *)malloc(sizeof(unsigned char) * size + 1); + if (buf == NULL) { + _ERR("buf is NULL"); + return; + } + g_variant_get(message, "a(y)", &iter); size = g_variant_iter_n_children(iter); - buf = (unsigned char *)malloc(sizeof(unsigned char) * size + 1); for (int i = 0; g_variant_iter_loop(iter, "(y)", &element); i++) { buf[i] = element;