Fix Coverity issues in common
[claws.git] / src / common / template.c
index 3fcbda2343a377dcce35dbc7886161205eadb521..b49b7d934381ad8425a4f25b215a55b3849f63bc 100644 (file)
@@ -280,8 +280,9 @@ static void template_write_config(GSList *tmpl_list)
                TRY_NO_CLOSE(fclose(fp) != EOF);
 
                if (new) {
-                       claws_unlink(filename);
-                       rename_force(new, filename);
+                       if (rename_force(new, filename) < 0) {
+                               FILE_OP_ERROR(new, "rename");
+                       }
                }
                g_free(new);
                g_free(filename);