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

@ -85,8 +85,7 @@ void path_list_clear(struct path_list *list, int free_items)
for (i = 0; i < list->nr; i++) {
if (list->strdup_paths)
free(list->items[i].path);
if (list->items[i].util)
free(list->items[i].util);
free(list->items[i].util);
}
free(list->items);
}