rerere: fix too-short initialization
authorJeff King <peff@peff.net>
Thu, 28 Jan 2010 14:52:16 +0000 (09:52 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 28 Jan 2010 17:30:14 +0000 (09:30 -0800)
This was caused by a typo in the sizeof parameter, and meant
we looked at uninitialized memory. Caught by valgrind in
t2030.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
rerere.c
index a86d73d9dcb0d07283885825a16286b3c7990ea2..d1d3e753955146cadfaf6da274487a4a369f0521 100644 (file)
--- a/rerere.c
+++ b/rerere.c
@@ -325,7 +325,7 @@ static int handle_cache(const char *path, unsigned char *sha1, const char *outpu
        for (i = 0; i < 3; i++)
                free(mmfile[i].ptr);
 
-       memset(&io, 0, sizeof(&io));
+       memset(&io, 0, sizeof(io));
        io.io.getline = rerere_mem_getline;
        if (output)
                io.io.output = fopen(output, "w");