refactor various if (x) FREE_AND_NULL(x) to just FREE_AND_NULL(x)
Change the few conditional uses of FREE_AND_NULL(x) to be unconditional. As noted in the standard[1] free(NULL) is perfectly valid, so we might as well leave this check up to the C library. 1. http://pubs.opengroup.org/onlinepubs/9699919799/functions/free.html Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
53f9a3e157
commit
ce528de023
4
http.c
4
http.c
@ -2418,9 +2418,7 @@ void release_http_object_request(struct http_object_request *freq)
|
||||
close(freq->localfile);
|
||||
freq->localfile = -1;
|
||||
}
|
||||
if (freq->url != NULL) {
|
||||
FREE_AND_NULL(freq->url);
|
||||
}
|
||||
FREE_AND_NULL(freq->url);
|
||||
if (freq->slot != NULL) {
|
||||
freq->slot->callback_func = NULL;
|
||||
freq->slot->callback_data = NULL;
|
||||
|
Reference in New Issue
Block a user