Browse Source

janitor: useless checks before free

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Pierre Habouzit 16 years ago committed by Junio C Hamano
parent
commit
24deea5273
  1. 3
      pack-revindex.c
  2. 2
      walker.c

3
pack-revindex.c

@ -149,8 +149,7 @@ void discard_revindex(void) @@ -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;
}

2
walker.c

@ -245,7 +245,7 @@ void walker_targets_free(int targets, char **target, const char **write_ref) @@ -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]);
}
}

Loading…
Cancel
Save