gitweb.cgi: Create $git_temp if it doesn't exist
[gitweb.git] / builtin-apply.c
index e9ead002d38368f6de6ba75f25542fe61258cfb9..c3af48917c9a96ce86442bea737f4a81c7e0fb55 100644 (file)
@@ -2323,7 +2323,7 @@ int cmd_apply(int argc, const char **argv, char **envp)
 
        if (write_index) {
                if (write_cache(newfd, active_cache, active_nr) ||
-                   commit_lock_file(&lock_file))
+                   close(newfd) || commit_lock_file(&lock_file))
                        die("Unable to write new index file");
        }