t0302 & t3900: add forgotten quotes
[gitweb.git] / config.c
index 3df7515db2e70e70a97b3a29dfd77d10dc462b3d..f0511e58e2af4235201a01618134a020592cf11c 100644 (file)
--- a/config.c
+++ b/config.c
@@ -2622,7 +2622,7 @@ int git_config_rename_section_in_file(const char *config_filename,
        struct lock_file *lock;
        int out_fd;
        char buf[1024];
-       FILE *config_file;
+       FILE *config_file = NULL;
        struct stat st;
 
        if (new_name && !section_name_is_ok(new_name)) {
@@ -2704,11 +2704,14 @@ int git_config_rename_section_in_file(const char *config_filename,
                }
        }
        fclose(config_file);
+       config_file = NULL;
 commit_and_out:
        if (commit_lock_file(lock) < 0)
                ret = error_errno("could not write config file %s",
                                  config_filename);
 out:
+       if (config_file)
+               fclose(config_file);
        rollback_lock_file(lock);
 out_no_rollback:
        free(filename_buf);