From: Linus Torvalds Date: Mon, 11 Apr 2005 06:33:52 +0000 (-0700) Subject: Oops. Fix bad initialization of the "seen" array, causing us to not X-Git-Tag: v0.99~922 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=91af81a98ea5c5594c67a63abc933250e05c13c6;p=git.git Oops. Fix bad initialization of the "seen" array, causing us to not properly clear the reference count at init time. It happened to work for me by pure luck. Until it broke, and my unreferenced commit suddenly looked referenced again. Fixed. --- diff --git a/fsck-cache.c b/fsck-cache.c index 87366f0e..bb5cf196 100644 --- a/fsck-cache.c +++ b/fsck-cache.c @@ -106,7 +106,7 @@ static int mark_sha1_seen(unsigned char *sha1, char *tag) seen = realloc(seen, alloc_seen*sizeof(struct seen)); } s = seen + nr_seen; - memset(s, 0, sizeof(s)); + memset(s, 0, sizeof(*s)); nr_seen++; memcpy(s->sha1, sha1, 20); strncpy(s->tag, tag, sizeof(s->tag));