From: MyungJoo Ham Date: Fri, 18 Aug 2023 05:26:25 +0000 (+0900) Subject: memleak fix: decoder/bounding-box X-Git-Tag: accepted/tizen/unified/20230830.170548~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=916f07e1d5b0a394dd7626c13d365e5d24b28cce;p=platform%2Fupstream%2Fnnstreamer.git 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 --- 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];