From a267a544def5593a2a31e1e2fded818b7aa6cb26 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Wed, 12 Jun 2024 13:21:49 -0700 Subject: [PATCH] lib/ec_glob: plug leak of nums utarray --- src/lib/ec_glob.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/ec_glob.c b/src/lib/ec_glob.c index c2b83cf..7064747 100644 --- a/src/lib/ec_glob.c +++ b/src/lib/ec_glob.c @@ -54,7 +54,7 @@ static const UT_icd ut_int_pair_icd = {sizeof(int_pair),NULL,NULL,NULL}; size_t string_len = strlen(string); \ assert(end > p); \ if (string_len >= (size_t)(end - p)) \ - return -1; \ + goto cleanup; \ strcat(p, string); \ p += string_len; \ } while(0) @@ -62,7 +62,7 @@ static const UT_icd ut_int_pair_icd = {sizeof(int_pair),NULL,NULL,NULL}; /* safely add a char to a string then move the pointer to the end */ #define ADD_CHAR(string, new_chr, end) do { \ if (string + 1 >= end) \ - return -1; \ + goto cleanup; \ *(string ++) = new_chr; \ } while(0)