aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2017-11-16 10:14:30 +0100
committerRafał Miłecki <rafal@milecki.pl>2017-11-17 11:32:51 +0100
commit36a92274a80056d224288721fa7c71b5ad9680b5 (patch)
treea3ec27f9bfdeb0d6305dd62b0b77c6523c0768c6 /package
parent70837168efe43d54bed21c83d50fa72336d45d53 (diff)
downloadupstream-36a92274a80056d224288721fa7c71b5ad9680b5.tar.gz
upstream-36a92274a80056d224288721fa7c71b5ad9680b5.tar.bz2
upstream-36a92274a80056d224288721fa7c71b5ad9680b5.zip
otrx: fix memory leak in otrx_create_append_zeros
A "free" call was missing after allocating a buffer. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'package')
-rw-r--r--package/utils/otrx/src/otrx.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/package/utils/otrx/src/otrx.c b/package/utils/otrx/src/otrx.c
index 0d99cd39e3..223e032f2b 100644
--- a/package/utils/otrx/src/otrx.c
+++ b/package/utils/otrx/src/otrx.c
@@ -264,9 +264,12 @@ static ssize_t otrx_create_append_zeros(FILE *trx, size_t length) {
if (fwrite(buf, 1, length, trx) != length) {
fprintf(stderr, "Couldn't write %zu B to %s\n", length, trx_path);
+ free(buf);
return -EIO;
}
+ free(buf);
+
return length;
}