diff options
author | Timo Teräs <timo.teras@iki.fi> | 2018-01-03 09:30:12 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2018-01-03 09:30:12 +0200 |
commit | 8ee79c72b2a6ad5971895bc3a95e633211962107 (patch) | |
tree | 83b12ae7eea7055982746f9912046a454f4a5bde /src/apk.c | |
parent | 667cb6bca799e58f58f22ad868761c022c6600dc (diff) | |
download | apk-tools-8ee79c72b2a6ad5971895bc3a95e633211962107.tar.gz apk-tools-8ee79c72b2a6ad5971895bc3a95e633211962107.tar.bz2 apk-tools-8ee79c72b2a6ad5971895bc3a95e633211962107.tar.xz apk-tools-8ee79c72b2a6ad5971895bc3a95e633211962107.zip |
apk, del: fix few memory leaks
This fixes couple of valgrind reported leaks - though they are
non-important since the leak happens on "exit" only and kernel
frees it anyway.
Diffstat (limited to 'src/apk.c')
-rw-r--r-- | src/apk.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -460,6 +460,7 @@ int main(int argc, char **argv) const struct apk_option_group **optgroups = default_optgroups; struct apk_string_array *args; + apk_string_array_init(&args); #ifdef TEST_MODE apk_string_array_init(&test_repos); #endif @@ -585,7 +586,6 @@ int main(int argc, char **argv) } #endif - apk_string_array_init(&args); apk_string_array_resize(&args, argc); memcpy(args->item, argv, argc * sizeof(*argv)); @@ -602,5 +602,8 @@ err: free(ctx); fetchConnectionCacheClose(); + apk_string_array_free(&args); + free(apk_argv); + return r; } |