{"thread":{"id":"9471","subject":"[PATCH] Fix handle leak in \"git branch -D\"","startedAt":"2007-08-10T13:06:57Z","lastAt":"2007-08-10T13:06:57Z","messageCount":1,"participants":["Alex Riesen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"50406","messageId":"81b0412b0708100606v7bcceaf6xc0783ea9761d7ba4@mail.gmail.com","threadId":"9471","inReplyTo":null,"subject":"[PATCH] Fix handle leak in \"git branch -D\"","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-08-10T13:06:57Z","receivedAt":"2007-08-10T13:06:57Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On Windows (it can't touch open files in any way) the following fails:\n\n    git branch -D branch1 branch2\n\nif the both branches are in packed-refs.\n\nSigned-off-by: Alex Riesen <raa.lkml@gmail.com>\n---\n refs.c |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\nBTW, why does not commit_lock_file takes care of closing the file\nopened by hold_lock_file_for_update?\n\n\nFrom 4e219bf5b2c7de091973336f6143f77fe9a96efc Mon Sep 17 00:00:00 2001\nFrom: Alex Riesen <raa.lkml@gmail.com>\nDate: Fri, 10 Aug 2007 15:06:22 +0200\nSubject: [PATCH] Fix handle leak in \"git branch -D\"\n\nOn Windows (it can't touch open files in any way) the following fails:\n\n    git branch -D branch1 branch2\n\nif the both branches are in packed-refs.\n\nSigned-off-by: Alex Riesen <raa.lkml@gmail.com>\n---\n refs.c |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/refs.c b/refs.c\nindex fac6548..09a2c87 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -869,6 +869,7 @@ static int repack_without_ref(const char *refname)\n \t\t\tdie(\"too long a refname '%s'\", list->name);\n \t\twrite_or_die(fd, line, len);\n \t}\n+\tclose(fd);\n \treturn commit_lock_file(&packlock);\n }\n \n-- \n1.5.3.rc4.81.gbd62\n\n"}]}