summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fc5fc50)
raw | patch | inline | side by side (parent: fc5fc50)
author | Rene Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Thu, 10 Aug 2006 15:02:35 +0000 (17:02 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 10 Aug 2006 21:15:49 +0000 (14:15 -0700) |
Plug memory leak in verify_one_pack() by freeing the struct packed_git
we got from add_packed_git(). Also rename g to pack and pull an
assignment out of an if statement while we're at it.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
we got from add_packed_git(). Also rename g to pack and pull an
assignment out of an if statement while we're at it.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
verify-pack.c | patch | blob | history |
diff --git a/verify-pack.c b/verify-pack.c
index c7293140f61798678ed8a25680c538a52ac225a8..78d789c62d9f80c21f701d65594f8b7c994e2e8b 100644 (file)
--- a/verify-pack.c
+++ b/verify-pack.c
{
char arg[PATH_MAX];
int len;
- struct packed_git *g;
+ struct packed_git *pack;
+ int err;
len = strlcpy(arg, path, PATH_MAX);
if (len >= PATH_MAX)
len += 4;
}
- if (!(g = add_packed_git(arg, len, 1)))
+ pack = add_packed_git(arg, len, 1);
+ if (!pack)
return error("packfile %s not found.", arg);
- return verify_pack(g, verbose);
+ err = verify_pack(pack, verbose);
+ free(pack);
+
+ return err;
}
static const char verify_pack_usage[] = "git-verify-pack [-v] <pack>...";