git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] memory leak reported by valgrind
@ 2010-08-09  9:48 Ivan Kanis
  2010-08-09 19:37 ` Junio C Hamano
  0 siblings, 1 reply; 33+ messages in thread
From: Ivan Kanis @ 2010-08-09  9:48 UTC (permalink / raw)
  To: git

Hello,

This patches the following memory leak reported by valgrind:

512 bytes in 1 blocks are definitely lost in loss record 5 of 8
  at 0x4C203E4: calloc (vg_replace_malloc.c:397)
  by 0x4C5F9D: xcalloc (wrapper.c:96)
  by 0x445741: cmd_pack_objects (pack-objects.c:2117)
  by 0x4048EE: handle_internal_command (git.c:270)
  by 0x404B03: main (git.c:470)


diff -u git-1.7.2.1/builtin/pack-objects.c git.ivan/builtin/pack-objects.c
--- git-1.7.2.1/builtin/pack-objects.c  2010-07-28 19:03:43.000000000 +0200
+++ git.ivan/builtin/pack-objects.c     2010-08-09 11:38:40.000000000 +0200
@@ -2341,5 +2341,6 @@
                fprintf(stderr, "Total %"PRIu32" (delta %"PRIu32"),"
                        " reused %"PRIu32" (delta %"PRIu32")\n",
                        written, written_delta, reused, reused_delta);
+       free(rp_av);
        return 0;
 }

-- 
Ivan Kanis

When you're looking at life
In a strange new room
Maybe drowning soon
Is this the start of it all?
    -- Ian Curtis 

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

end of thread, other threads:[~2010-10-06 22:21 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-09  9:48 [PATCH] memory leak reported by valgrind Ivan Kanis
2010-08-09 19:37 ` Junio C Hamano
2010-08-09 20:19   ` Erik Faye-Lund
2010-08-09 20:29     ` Alex Riesen
2010-08-10  3:26   ` Jonathan Nieder
2010-08-10  3:28     ` [PATCH/RFC 1/3] core: Stop leaking ondisk_cache_entrys Jonathan Nieder
2010-08-10  3:32     ` [PATCH/RFC 2/3] write-tree: Avoid leak when index refers to an invalid object Jonathan Nieder
2010-08-10  3:33     ` [PATCH/RFC 3/3] read-tree: stop leaking tree objects Jonathan Nieder
2010-10-02  8:27     ` [PATCH/RFC 0/7] Re: [PATCH] memory leak reported by valgrind Jonathan Nieder
2010-10-02  8:31       ` [PATCH 1/7] init: plug tiny one-time memory leak Jonathan Nieder
2010-10-03 23:46         ` Junio C Hamano
2010-10-04  4:34           ` [PATCH v2] " Jonathan Nieder
2010-10-02  8:32       ` [PATCH 2/7] lockfile: introduce alloc_lock_file() to avoid valgrind noise Jonathan Nieder
2010-10-02 16:30         ` Andreas Ericsson
2010-10-02 16:43           ` Jonathan Nieder
2010-10-06 20:10         ` Junio C Hamano
2010-10-06 20:21           ` Jonathan Nieder
2010-10-06 21:45             ` Junio C Hamano
2010-10-06 22:17               ` Jonathan Nieder
2010-10-02  8:35       ` [PATCH 3/7] environment.c: remove unused variable Jonathan Nieder
2010-10-02  8:36       ` [PATCH 4/7] setup: make sure git dir path is in a permanent buffer Jonathan Nieder
2010-10-04  9:25         ` Nguyen Thai Ngoc Duy
2010-10-02  8:38       ` [PATCH 5/7] Introduce malloc/strdup/pathdup variants for permanent allocations Jonathan Nieder
2010-10-02  8:39       ` [PATCH 6/7] environment: use alloc_permanent() for computed git_dir and co Jonathan Nieder
2010-10-02  8:41       ` [PATCH 7/7] commit-tree: free commit message before exiting Jonathan Nieder
2010-10-02 18:14         ` Sverre Rabbelier
2010-10-02 18:26           ` Jonathan Nieder
2010-10-02 20:12             ` Sverre Rabbelier
2010-10-02 20:50               ` Jonathan Nieder
2010-10-04  0:31         ` Junio C Hamano
2010-10-04  4:18           ` Jonathan Nieder
2010-10-04  7:55             ` Junio C Hamano
2010-10-04  7:56               ` Jonathan Nieder

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).