aboutsummaryrefslogtreecommitdiff
path: root/blaze822.c
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2019-02-10 22:03:09 +0100
committerLeah Neukirchen <leah@vuxu.org>2019-02-10 22:03:09 +0100
commit4198cd42fa5ed4be05663e8e1e8596839f29a8ee (patch)
tree6cfbd8e82ac011363af1d4c611537cd1f8d15466 /blaze822.c
parent4e9237f921d753079cb0930bcc0f0f4a5e41939a (diff)
downloadmblaze-4198cd42fa5ed4be05663e8e1e8596839f29a8ee.tar.gz
blaze822: blaze822_mem: fix memleak
Found by clang 7.0.1.
Diffstat (limited to 'blaze822.c')
-rw-r--r--blaze822.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/blaze822.c b/blaze822.c
index afde3c1..7175d8c 100644
--- a/blaze822.c
+++ b/blaze822.c
@@ -507,8 +507,10 @@ blaze822_mem(char *src, size_t len)
size_t hlen = end - src;
buf = malloc(hlen+1);
- if (!buf)
+ if (!buf) {
+ free(mesg);
return 0;
+ }
memcpy(buf, src, hlen);
end = buf+hlen;