From 916f07e1d5b0a394dd7626c13d365e5d24b28cce Mon Sep 17 00:00:00 2001 From: MyungJoo Ham Date: Fri, 18 Aug 2023 14:26:25 +0900 Subject: [PATCH] memleak fix: decoder/bounding-box "results" is allocated in ```_get_objects_mp_palm_detection_``` macro. Do not allocate it before calling it. Fixes #4185 Signed-off-by: MyungJoo Ham --- ext/nnstreamer/tensor_decoder/tensordec-boundingbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/nnstreamer/tensor_decoder/tensordec-boundingbox.c b/ext/nnstreamer/tensor_decoder/tensordec-boundingbox.c index 44023a1..ffbfd6a 100644 --- a/ext/nnstreamer/tensor_decoder/tensordec-boundingbox.c +++ b/ext/nnstreamer/tensor_decoder/tensordec-boundingbox.c @@ -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]; -- 2.7.4