Skip to content

Commit

Permalink
Fix another batch of issues detected by covscans
Browse files Browse the repository at this point in the history
  • Loading branch information
kontura authored and Conan-Kudo committed Jul 23, 2021
1 parent 0a7ae50 commit 3cd5a29
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mergerepo_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/python/xml_dump-py.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions src/repomd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/sqliterepo_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions src/xml_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 3cd5a29

Please sign in to comment.