memleak fix: decoder/bounding-box
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 18 Aug 2023 05:26:25 +0000 (14:26 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Tue, 22 Aug 2023 02:52:18 +0000 (11:52 +0900)
"results" is allocated in ```_get_objects_mp_palm_detection_``` macro.
Do not allocate it before calling it.

Fixes #4185

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
ext/nnstreamer/tensor_decoder/tensordec-boundingbox.c

index 44023a1..ffbfd6a 100644 (file)
@@ -1978,7 +1978,7 @@ bb_decode (void **pdata, const GstTensorsConfig * config,
 
     /* Already checked with getOutCaps. Thus, this is an internal bug */
     g_assert (num_tensors >= MP_PALM_DETECTION_MAX_TENSORS);
-    results = g_array_sized_new (FALSE, TRUE, sizeof (detectedObject), 100);
+    /* results will be allocated by _get_objects_mp_palm_detection_ */
 
     boxes = &input[0];
     detections = &input[1];