free(NULL) is perfectly valid.

Jonas noticed some places say "if (X) free(X)" which is totally
unnecessary.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano
2006-08-27 21:19:39 -07:00
parent b3c952f838
commit 4cac42b132
10 changed files with 21 additions and 44 deletions

View File

@ -93,10 +93,8 @@ static void show_commit(struct commit *commit)
free_commit_list(commit->parents);
commit->parents = NULL;
}
if (commit->buffer) {
free(commit->buffer);
commit->buffer = NULL;
}
free(commit->buffer);
commit->buffer = NULL;
}
static void process_blob(struct blob *blob,