[SVACE/414629] Check malloc return value.
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 1 Apr 2019 07:49:13 +0000 (16:49 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 1 Apr 2019 10:46:08 +0000 (19:46 +0900)
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 <myungjoo.ham@samsung.com>
nnstreamer_example/custom_example_average/nnstreamer_customfilter_example_average.c

index 1e4bd3f..e69d016 100644 (file)
@@ -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;
 }