From 6059b7f2c97595aca5077e6c357617ff132e79fd Mon Sep 17 00:00:00 2001 From: Artur Cygan Date: Thu, 15 Aug 2024 12:52:32 +0200 Subject: [PATCH] Fix memory leak in _zbar_sq_decode --- zbar/sqcode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zbar/sqcode.c b/zbar/sqcode.c index 422c803d..a5e808fc 100644 --- a/zbar/sqcode.c +++ b/zbar/sqcode.c @@ -371,7 +371,7 @@ found_start:; border_len = 1; top_border = malloc(sizeof(sq_point)); if (!top_border) - return 1; + goto free_borders; top_border[0] = top_left_dot.center; } } @@ -471,7 +471,7 @@ found_start:; } } if (cur_len != border_len || border_len < 6) - return 1; + goto free_borders; inc_x = right_border[5].x - right_border[3].x; inc_y = right_border[5].y - right_border[3].y; right_border[2].x = right_border[3].x - 0.5 * inc_x;