Merge pull request #19030 from dtardon/rhel9-covscan

a bunch of small fixes and clenups based on initial RHEL-9 covscan run
This commit is contained in:
Luca Boccassi
2021-03-18 16:28:46 +00:00
committed by GitHub
4 changed files with 37 additions and 44 deletions
+5 -3
View File
@@ -187,10 +187,12 @@ static int create_edit_temp_file(const char *new_path, const char *original_path
fprintf(f, "\n\n### %s", *path);
if (!isempty(contents)) {
contents = strreplace(strstrip(contents), "\n", "\n# ");
if (!contents)
_cleanup_free_ char *commented_contents = NULL;
commented_contents = strreplace(strstrip(contents), "\n", "\n# ");
if (!commented_contents)
return log_oom();
fprintf(f, "\n# %s", contents);
fprintf(f, "\n# %s", commented_contents);
}
}