From fcb1c5e387ccb89204a43ad9c5ddc985c02ab95e Mon Sep 17 00:00:00 2001 From: MyungJoo Ham Date: Mon, 1 Apr 2019 16:49:13 +0900 Subject: [PATCH] [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 --- .../custom_example_average/nnstreamer_customfilter_example_average.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.7.4