From bf9a7e25363e010b50b076cad3505207a757c7d1 Mon Sep 17 00:00:00 2001
From: Jan Kaluza <jkaluza@redhat.com>
Date: Wed, 25 Jul 2018 15:05:11 +0200
Subject: [PATCH] Fix missing packages in mergerepo_c in case multiple VR
exists for single pkg in repo.
---
src/mergerepo_c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/mergerepo_c.c b/src/mergerepo_c.c
index 94b929c..ad20a84 100644
--- a/src/mergerepo_c.c
+++ b/src/mergerepo_c.c
@@ -471,7 +471,7 @@ new_merged_metadata_hashtable()
{
GHashTable *hashtable = g_hash_table_new_full(g_str_hash,
g_str_equal,
- NULL,
+ g_free,
free_merged_values);
return hashtable;
}
@@ -824,7 +824,7 @@ add_package(cr_Package *pkg,
repopath_with_protocol = prepend_protocol(repopath);
pkg->location_base = cr_safe_string_chunk_insert(pkg->chunk, repopath_with_protocol);
}
- g_hash_table_insert (merged, (gpointer) pkg->name, (gpointer) list);
+ g_hash_table_insert (merged, (gpointer) g_strdup(pkg->name), (gpointer) list);
return 1;
}