projects
/
openwrt
/
staging
/
yousong.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7083716
)
otrx: fix memory leak in otrx_create_append_zeros
author
Rafał Miłecki
<rafal@milecki.pl>
Thu, 16 Nov 2017 09:14:30 +0000
(10:14 +0100)
committer
Rafał Miłecki
<rafal@milecki.pl>
Fri, 17 Nov 2017 10:32:51 +0000
(11:32 +0100)
A "free" call was missing after allocating a buffer.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
package/utils/otrx/src/otrx.c
patch
|
blob
|
history
diff --git
a/package/utils/otrx/src/otrx.c
b/package/utils/otrx/src/otrx.c
index 0d99cd39e3e21321236522a2e50e9016be29d15d..223e032f2b5ed81c792b10373c46c21468fae0d4 100644
(file)
--- 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;
}