Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/rpm-software-management/createrepo_c.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleš Matěj <amatej@redhat.com>2022-02-22 12:34:44 +0300
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>2022-03-07 17:55:06 +0300
commitb9daab0738b58e5477326b39372bf11d302f0c4d (patch)
tree55ea8ae94dd0021843a29d45984d2be8ed21278e
parentace4c87a392b8c25fd7127da49516dba52d397c9 (diff)
Free `in_progress_pkgs_list` fully only when there is no newpkgcb
Normally the `in_progress_pkgs_list` is empty (all packages get parsed and processed) however there are cases such as hitting an error or interrupting parsing when there can be packages present. If there are packages we can free them only if there is no newpkgcb because otherwise their references are stored in python layer which then also tries to free them leading to a crash.
-rw-r--r--src/xml_parser_main_metadata_together.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/xml_parser_main_metadata_together.c b/src/xml_parser_main_metadata_together.c
index 863c69e..f2632a2 100644
--- a/src/xml_parser_main_metadata_together.c
+++ b/src/xml_parser_main_metadata_together.c
@@ -462,7 +462,11 @@ out:
if (allow_out_of_order) {
g_hash_table_destroy(cbdata.in_progress_pkgs_hash);
} else {
- cr_slist_free_full(cbdata.in_progress_pkgs_list, (GDestroyNotify) cr_package_free);
+ if (cbdata.newpkgcb) {
+ g_slist_free(cbdata.in_progress_pkgs_list);
+ } else {
+ cr_slist_free_full(cbdata.in_progress_pkgs_list, (GDestroyNotify) cr_package_free);
+ }
}
return ret;