[PATCH] fix for memory leak in write-tree.c

Fix a memory leak in write-tree.c, not freeing the directory buffer.
This commit is contained in:
Brad Roberts 2005-04-17 10:55:12 -07:00 коммит произвёл Linus Torvalds
Родитель e8871e88ad
Коммит 7223a88ce7
1 изменённых файлов: 2 добавлений и 4 удалений

Просмотреть файл

@ -93,10 +93,8 @@ static int write_tree(struct cache_entry **cachep, int maxentries, const char *b
i -= 5;
memcpy(buffer+i, "tree ", 5);
buffer += i;
offset -= i;
write_sha1_file(buffer, offset, returnsha1);
write_sha1_file(buffer + i, offset - i, returnsha1);
free(buffer);
return nr;
}