summaryrefslogtreecommitdiffstats
path: root/src/opk
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2023-07-05 21:40:16 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2023-07-05 21:40:16 (EDT)
commitd9e2315039bb22f7086aa4c9eda629f9f6e82b91 (patch)
treeaee467ec1da5b60e14476db39ad7e78eb2fbc305 /src/opk
parentff654bc17301a575fa547ad77a9253221ba05164 (diff)
opk/write: Fix memory leaks
opk->temp_file_name wasn't freed when either of the _opkg_opk_opk_build_inner_archive() calls failed. Fixes: Direct leak of 73 byte(s) in 1 object(s) allocated from: #0 0x7fde9c5c4d28 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc1d28) #1 0x563aeebbc4e8 in opkg_opk_opk_write src/opk/write.c:512 #2 0x563aeebb4351 in main src/main.c:357 #3 0x7fde9bc5b2e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
Diffstat (limited to 'src/opk')
-rw-r--r--src/opk/write.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/opk/write.c b/src/opk/write.c
index ae8a799..284b625 100644
--- a/src/opk/write.c
+++ b/src/opk/write.c
@@ -519,13 +519,13 @@ opkg_opk_opk_write(struct opkg_opk_opk *opk, const char *file_name)
OPKG_OPK_OPK_ARCHIVE_TYPE_CONTROL_) !=
OPKG_OPK_OK) {
ret = OPKG_OPK_ERROR;
- goto out4;
+ goto out5;
}
if (_opkg_opk_opk_build_inner_archive(opk,
OPKG_OPK_OPK_ARCHIVE_TYPE_DATA_) !=
OPKG_OPK_OK) {
ret = OPKG_OPK_ERROR;
- goto out4;
+ goto out5;
}
/* Write trailer. */