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>2021-07-14 13:51:53 +0300
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>2021-07-23 17:30:47 +0300
commit3cd5a298878032ea3766b3defe6d69b52589583c (patch)
treee46f2b43bb7149fadc7decff3d7cbd5227bbfdd5
parent0a7ae501925c91968f6ecdac4a08170fc731fc07 (diff)
Fix another batch of issues detected by covscans
-rw-r--r--src/mergerepo_c.c2
-rw-r--r--src/python/xml_dump-py.c2
-rw-r--r--src/repomd.c1
-rw-r--r--src/sqliterepo_c.c1
-rw-r--r--src/xml_file.c1
5 files changed, 7 insertions, 0 deletions
diff --git a/src/mergerepo_c.c b/src/mergerepo_c.c
index 00cee70..a855eb1 100644
--- a/src/mergerepo_c.c
+++ b/src/mergerepo_c.c
@@ -984,6 +984,7 @@ dump_merged_metadata(GHashTable *merged_hashtable,
g_free(fil_xml_filename);
g_free(oth_xml_filename);
g_free(update_info_filename);
+ cr_xmlfile_close(fil_f, NULL);
cr_xmlfile_close(pri_f, NULL);
g_error_free(tmp_err);
g_free(pri_dict);
@@ -1008,6 +1009,7 @@ dump_merged_metadata(GHashTable *merged_hashtable,
g_free(fil_xml_filename);
g_free(oth_xml_filename);
g_free(update_info_filename);
+ cr_xmlfile_close(oth_f, NULL);
cr_xmlfile_close(fil_f, NULL);
cr_xmlfile_close(pri_f, NULL);
g_error_free(tmp_err);
diff --git a/src/python/xml_dump-py.c b/src/python/xml_dump-py.c
index de86a29..8cbc01d 100644
--- a/src/python/xml_dump-py.c
+++ b/src/python/xml_dump-py.c
@@ -62,6 +62,7 @@ py_xml_dump_filelists(G_GNUC_UNUSED PyObject *self, PyObject *args)
xml = cr_xml_dump_filelists(Package_FromPyObject(py_pkg), &err);
if (err) {
nice_exception(&err, NULL);
+ free(xml);
return NULL;
}
@@ -83,6 +84,7 @@ py_xml_dump_other(G_GNUC_UNUSED PyObject *self, PyObject *args)
xml = cr_xml_dump_other(Package_FromPyObject(py_pkg), &err);
if (err) {
nice_exception(&err, NULL);
+ free(xml);
return NULL;
}
diff --git a/src/repomd.c b/src/repomd.c
index 82370d9..2e7d9cc 100644
--- a/src/repomd.c
+++ b/src/repomd.c
@@ -279,6 +279,7 @@ cr_repomd_record_fill(cr_RepomdRecord *md,
g_propagate_prefixed_error(err, tmp_err,
"Error while computing stat of compressed content of %s:",
path);
+ cr_contentstat_free(open_stat, NULL);
return code;
}
md->checksum_open_type = g_string_chunk_insert(md->chunk, checksum_str);
diff --git a/src/sqliterepo_c.c b/src/sqliterepo_c.c
index ad77958..059f651 100644
--- a/src/sqliterepo_c.c
+++ b/src/sqliterepo_c.c
@@ -762,6 +762,7 @@ generate_sqlite_from_xml(const gchar *path,
if (!md_loc || !md_loc->repomd) {
g_set_error(err, CREATEREPO_C_ERROR, CRE_NOFILE,
"repomd.xml doesn't exist");
+ cr_metadatalocation_free(md_loc);
return FALSE;
}
diff --git a/src/xml_file.c b/src/xml_file.c
index d4d1fe9..32458aa 100644
--- a/src/xml_file.c
+++ b/src/xml_file.c
@@ -389,6 +389,7 @@ cr_rewrite_header_package_count(gchar *original_filename,
g_propagate_prefixed_error(err, tmp_err, "Error encountered while opening for writing:");
cr_close(original_file, NULL);
g_free(tmp_xml_filename);
+ cr_xmlfile_close(new_file, NULL);
return;
}