git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] fix for memory leak in write-tree.c
@ 2005-04-17 11:21 Brad Roberts
  2005-04-17 11:23 ` Petr Baudis
  0 siblings, 1 reply; 2+ messages in thread
From: Brad Roberts @ 2005-04-17 11:21 UTC (permalink / raw)
  To: git

I've made my tree rsync'able:

rsync://gameboy2.puremagic.com/git


commit 1cdbc0a19b8d9b68f1f42735e2f14f1289823a63
tree 0e060fed0642337e675368913ec8d4f910a9f019
parent 11ed64c1b141c9ba397a1ca76aef2cd250976007
author Brad Roberts,,, <braddr@gameboy2> 1113736632 -0700
committer Brad Roberts,,, <braddr@gameboy2> 1113736632 -0700

Fix a memory leak in write-tree.c, not freeing the directory buffer.

Index: write-tree.c
===================================================================
--- 51b1bddbbc05e50d5bbf1f9662e503c2e85d5e96/write-tree.c  (mode:100644 sha1:34a351b20fb38ea588f34bd9634f101b9dc533cb)
+++ 0e060fed0642337e675368913ec8d4f910a9f019/write-tree.c  (mode:100644 sha1:fb046aa6ce6b9fce6a523a1e36ff43adab9bdd93)
@@ -93,10 +93,8 @@
        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;
 }




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: fix for memory leak in write-tree.c
  2005-04-17 11:21 [patch] fix for memory leak in write-tree.c Brad Roberts
@ 2005-04-17 11:23 ` Petr Baudis
  0 siblings, 0 replies; 2+ messages in thread
From: Petr Baudis @ 2005-04-17 11:23 UTC (permalink / raw)
  To: Brad Roberts; +Cc: git

Dear diary, on Sun, Apr 17, 2005 at 01:21:56PM CEST, I got a letter
where Brad Roberts <braddr@puremagic.com> told me that...
> I've made my tree rsync'able:
> 
> rsync://gameboy2.puremagic.com/git
> 
> 
> commit 1cdbc0a19b8d9b68f1f42735e2f14f1289823a63
> tree 0e060fed0642337e675368913ec8d4f910a9f019
> parent 11ed64c1b141c9ba397a1ca76aef2cd250976007
> author Brad Roberts,,, <braddr@gameboy2> 1113736632 -0700
> committer Brad Roberts,,, <braddr@gameboy2> 1113736632 -0700

If we are supposed to merge with you, it would be nice if you used a
real email address. (The commas are livable but if you can get rid of
them... ;-)

Thanks,

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-04-17 11:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-17 11:21 [patch] fix for memory leak in write-tree.c Brad Roberts
2005-04-17 11:23 ` Petr Baudis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).