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>
This commit is contained in:
parent
70837168ef
commit
36a92274a8
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue