[PATCH] memory leak reported by valgrind

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]