X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=entry.c;h=cfadc6a292033d349f6b1efff75d2c4f9f2525fe;hb=5410a02ab9e6a1987147724f8ea65e6a077b3832;hp=98f5f6d4ecfc0dabae9a920bdf3beadbf20abcaf;hpb=6e863d6d129a1b6a13c66d0bb03f3d43db6c51fe;p=git.git diff --git a/entry.c b/entry.c index 98f5f6d4e..cfadc6a29 100644 --- a/entry.c +++ b/entry.c @@ -119,8 +119,10 @@ static int write_entry(struct cache_entry *ce, char *path, const struct checkout */ strbuf_init(&buf, 0); if (convert_to_working_tree(ce->name, new, size, &buf)) { + size_t newsize = 0; free(new); - new = strbuf_detach(&buf, &size); + new = strbuf_detach(&buf, &newsize); + size = newsize; } if (to_tempfile) {