From e02664c61d27feae1d6dcdda4a3af54e873ee9bd Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 29 Oct 2021 15:06:09 +0300 Subject: Fixed a memory leak in URL handling --- src/gmutil.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gmutil.c b/src/gmutil.c index 22219221..ee8f150a 100644 --- a/src/gmutil.c +++ b/src/gmutil.c @@ -658,7 +658,11 @@ const iString *canonicalUrl_String(const iString *d) { /* This is done separately to avoid the copy if %3A is not present; it's rare. */ canon = copy_String(d); urlDecodePath_String(canon); - urlDecodeExclude_String(d, "%/?:;#&= "); /* decode everything else in all parts */ + iString *dec = maybeUrlDecodeExclude_String(canon, "%/?:;#&= "); /* decode everything else in all parts */ + if (dec) { + set_String(canon, dec); + delete_String(dec); + } } else { canon = maybeUrlDecodeExclude_String(d, "%/?:;#&= "); -- cgit v1.2.3