From: Pierre Habouzit Date: Wed, 22 Jul 2009 21:51:55 +0000 (+0200) Subject: janitor: useless checks before free X-Git-Tag: v1.6.4-rc2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=24deea5273709f3685f981c33468a0cead6cc147;p=git.git janitor: useless checks before free Signed-off-by: Pierre Habouzit Signed-off-by: Junio C Hamano --- diff --git a/pack-revindex.c b/pack-revindex.c index 1de53c893..77a0465be 100644 --- a/pack-revindex.c +++ b/pack-revindex.c @@ -149,8 +149,7 @@ void discard_revindex(void) if (pack_revindex_hashsz) { int i; for (i = 0; i < pack_revindex_hashsz; i++) - if (pack_revindex[i].revindex) - free(pack_revindex[i].revindex); + free(pack_revindex[i].revindex); free(pack_revindex); pack_revindex_hashsz = 0; } diff --git a/walker.c b/walker.c index e57630e98..11d9052ed 100644 --- a/walker.c +++ b/walker.c @@ -245,7 +245,7 @@ void walker_targets_free(int targets, char **target, const char **write_ref) { while (targets--) { free(target[targets]); - if (write_ref && write_ref[targets]) + if (write_ref) free((char *) write_ref[targets]); } }