Skip to content

Commit

Permalink
janitor: useless checks before free
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
MadCoder authored and gitster committed Jul 23, 2009
1 parent 98cb6f3 commit 24deea5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions pack-revindex.c
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion walker.c
Expand Up @@ -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]);
}
}
Expand Down

0 comments on commit 24deea5

Please sign in to comment.