summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2020-07-10 22:49:56 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2020-07-10 22:49:56 +0100
commit63c4307e5873801eaed051ef258d90a52a7d19e7 (patch)
tree65394d21302bffa005cd3b2f96be82953623e754
parent99ea5f6faeaf714e34bbcd75fdc50cc94dc7a1c8 (diff)
Release unused memory in parse_quote_2047()
-rw-r--r--src/src/parse.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/src/parse.c b/src/src/parse.c
index acece9b78..2b2ffd341 100644
--- a/src/src/parse.c
+++ b/src/src/parse.c
@@ -904,8 +904,13 @@ for (s = string; len > 0; s++, len--)
{ g = string_catn(g, s, 1); first_byte = FALSE; }
}
-g = string_catn(g, US"?=", 2);
-return coded ? string_from_gstring(g) : string;
+if (coded)
+ string = string_from_gstring(g = string_catn(g, US"?=", 2));
+else
+ g->ptr = -1;
+
+gstring_release_unused(g);
+return string;
}