From b8a1d2544c97c777c749f9b33a66cec837df676e Mon Sep 17 00:00:00 2001 From: MyungJoo Ham Date: Mon, 1 Apr 2019 16:53:17 +0900 Subject: [PATCH] [SVACE/414630] Check malloc return value Do not proceed if malloc returns null: Warning Message Pointer 'data' returned from function 'malloc' at nnstreamer_customfilter_example_scaler.c:45 may be null, and it is dereferenced at nnstreamer_customfilter_example_scaler.c:48. Signed-off-by: MyungJoo Ham --- .../custom_example_scaler/nnstreamer_customfilter_example_scaler.c | 1 + 1 file changed, 1 insertion(+) diff --git a/nnstreamer_example/custom_example_scaler/nnstreamer_customfilter_example_scaler.c b/nnstreamer_example/custom_example_scaler/nnstreamer_customfilter_example_scaler.c index 2e2c334..876411f 100644 --- a/nnstreamer_example/custom_example_scaler/nnstreamer_customfilter_example_scaler.c +++ b/nnstreamer_example/custom_example_scaler/nnstreamer_customfilter_example_scaler.c @@ -43,6 +43,7 @@ static void * pt_init (const GstTensorFilterProperties * prop) { pt_data *data = (pt_data *) malloc (sizeof (pt_data)); + assert (data); if (prop->custom_properties && strlen (prop->custom_properties) > 0) data->property = g_strdup (prop->custom_properties); -- 2.7.4