summaryrefslogtreecommitdiff
path: root/src/package.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2023-04-12 09:57:10 +0300
committerTimo Teräs <timo.teras@iki.fi>2023-04-12 10:09:33 +0300
commit0c4fc6519a78b307f4a113f8da36cf21368df882 (patch)
tree39f48f245bdaaf48e43dddf09507329079f1fe45 /src/package.c
parentd7650fc5e5a0119879d536b2c3c99ce85befd221 (diff)
downloadapk-tools-0c4fc6519a78b307f4a113f8da36cf21368df882.tar.gz
apk-tools-0c4fc6519a78b307f4a113f8da36cf21368df882.tar.bz2
apk-tools-0c4fc6519a78b307f4a113f8da36cf21368df882.tar.xz
apk-tools-0c4fc6519a78b307f4a113f8da36cf21368df882.zip
pkg: fix filename memory leak
Diffstat (limited to 'src/package.c')
-rw-r--r--src/package.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/package.c b/src/package.c
index 6596694..5aa4a67 100644
--- a/src/package.c
+++ b/src/package.c
@@ -958,19 +958,16 @@ err:
void apk_pkg_free(struct apk_package *pkg)
{
- if (pkg == NULL)
- return;
+ if (pkg == NULL) return;
apk_pkg_uninstall(NULL, pkg);
apk_dependency_array_free(&pkg->depends);
apk_dependency_array_free(&pkg->provides);
apk_dependency_array_free(&pkg->install_if);
- if (pkg->url)
- free(pkg->url);
- if (pkg->description)
- free(pkg->description);
- if (pkg->commit)
- free(pkg->commit);
+ if (pkg->url) free(pkg->url);
+ if (pkg->description) free(pkg->description);
+ if (pkg->commit) free(pkg->commit);
+ if (pkg->filename) free(pkg->filename);
free(pkg);
}