Although `man 3 unlink` doesn't mention what should be the unlink() behaviour when NULL is passed to it, both coverity and clang complains about that. Error: FORWARD_NULL (CWE-476): osinfo-db-tools-1.5.0/tools/osinfo-db-import.c:157: var_compare_op: Comparing "*source_file" to null implies that "*source_file" might be null. osinfo-db-tools-1.5.0/tools/osinfo-db-import.c:181: var_deref_model: Passing null pointer "*source_file" to "unlink", which dereferences it. # 179| g_error_free(err); # 180| if (ret != 0) # 181|-> unlink(*source_file); # 182| # 183| return ret; Error: CLANG_WARNING: osinfo-db-tools-1.5.0/tools/osinfo-db-import.c:181:9: warning: Null pointer passed as an argument to a 'nonnull' parameter # unlink(*source_file); # ^ Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx> --- tools/osinfo-db-import.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/osinfo-db-import.c b/tools/osinfo-db-import.c index 920f71b..11e68ae 100644 --- a/tools/osinfo-db-import.c +++ b/tools/osinfo-db-import.c @@ -177,7 +177,7 @@ osinfo_db_import_download_file(GFile *file, g_object_unref(out); if (err != NULL) g_error_free(err); - if (ret != 0) + if (ret != 0 && *source_file != NULL) unlink(*source_file); return ret; -- 2.21.0 _______________________________________________ Libosinfo mailing list Libosinfo@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libosinfo