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.cute-signatures
parent
667cb6bca7
commit
8ee79c72b2
|
@ -460,6 +460,7 @@ int main(int argc, char **argv)
|
||||||
const struct apk_option_group **optgroups = default_optgroups;
|
const struct apk_option_group **optgroups = default_optgroups;
|
||||||
struct apk_string_array *args;
|
struct apk_string_array *args;
|
||||||
|
|
||||||
|
apk_string_array_init(&args);
|
||||||
#ifdef TEST_MODE
|
#ifdef TEST_MODE
|
||||||
apk_string_array_init(&test_repos);
|
apk_string_array_init(&test_repos);
|
||||||
#endif
|
#endif
|
||||||
|
@ -585,7 +586,6 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
apk_string_array_init(&args);
|
|
||||||
apk_string_array_resize(&args, argc);
|
apk_string_array_resize(&args, argc);
|
||||||
memcpy(args->item, argv, argc * sizeof(*argv));
|
memcpy(args->item, argv, argc * sizeof(*argv));
|
||||||
|
|
||||||
|
@ -602,5 +602,8 @@ err:
|
||||||
free(ctx);
|
free(ctx);
|
||||||
|
|
||||||
fetchConnectionCacheClose();
|
fetchConnectionCacheClose();
|
||||||
|
apk_string_array_free(&args);
|
||||||
|
free(apk_argv);
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,6 +151,7 @@ static int del_main(void *pctx, struct apk_database *db, struct apk_string_array
|
||||||
} else {
|
} else {
|
||||||
apk_solver_print_errors(db, &changeset, ctx->world);
|
apk_solver_print_errors(db, &changeset, ctx->world);
|
||||||
}
|
}
|
||||||
|
apk_change_array_free(&changeset.changes);
|
||||||
apk_dependency_array_free(&ctx->world);
|
apk_dependency_array_free(&ctx->world);
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
|
|
Loading…
Reference in New Issue