about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2019-02-10 22:06:56 +0100
committerLeah Neukirchen <leah@vuxu.org>2019-02-10 22:06:56 +0100
commitcb0ffbf6adbddc6be47455dce6b37bff85cb9272 (patch)
treeaf9893fe2189877497815413bf86ecabc9d04db1
parent6ea32480f14542f71c6d192ae2d3a7898c9cd66b (diff)
downloadmblaze-cb0ffbf6adbddc6be47455dce6b37bff85cb9272.tar.gz
mblaze-cb0ffbf6adbddc6be47455dce6b37bff85cb9272.tar.xz
mblaze-cb0ffbf6adbddc6be47455dce6b37bff85cb9272.zip
rfc2231: fix memleak
Found by clang 7.0.1.
-rw-r--r--rfc2231.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/rfc2231.c b/rfc2231.c
index cc36970..fcdd418 100644
--- a/rfc2231.c
+++ b/rfc2231.c
@@ -54,8 +54,10 @@ found_extended:
 				if (!srcenc)
 					return 0;
 				sbuf = strchr(sbuf+1, '\'');
-				if (!sbuf)
+				if (!sbuf) {
+					free(srcenc);
 					return 0;
+				}
 				sbuf++;
 			}
 			while (sbuf < ebuf && dst < dstend) {