From: MyungJoo Ham Date: Mon, 1 Apr 2019 07:49:13 +0000 (+0900) Subject: [SVACE/414629] Check malloc return value. X-Git-Tag: accepted/tizen/unified/20190402.071859~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fcb1c5e387ccb89204a43ad9c5ddc985c02ab95e;p=platform%2Fupstream%2Fnnstreamer.git [SVACE/414629] Check malloc return value. If it's NULL, don't proceed: Warning Message Pointer 'data' returned from function 'malloc' at nnstreamer_customfilter_example_average.c:36 may be null, and it is dereferenced at nnstreamer_customfilter_example_average.c:38. Signed-off-by: MyungJoo Ham --- diff --git a/nnstreamer_example/custom_example_average/nnstreamer_customfilter_example_average.c b/nnstreamer_example/custom_example_average/nnstreamer_customfilter_example_average.c index 1e4bd3f..e69d016 100644 --- a/nnstreamer_example/custom_example_average/nnstreamer_customfilter_example_average.c +++ b/nnstreamer_example/custom_example_average/nnstreamer_customfilter_example_average.c @@ -34,7 +34,7 @@ static void * pt_init (const GstTensorFilterProperties * prop) { pt_data *data = (pt_data *) malloc (sizeof (pt_data)); - + assert (data); data->id = 0; return data; }