From ce528de023f82d767096b0342b6da8039feff7bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Fri, 17 Aug 2018 13:02:50 +0000 Subject: refactor various if (x) FREE_AND_NULL(x) to just FREE_AND_NULL(x) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- blame.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'blame.c') diff --git a/blame.c b/blame.c index 14d0e0b575..f9b7f0a0de 100644 --- a/blame.c +++ b/blame.c @@ -313,9 +313,7 @@ static void fill_origin_blob(struct diff_options *opt, static void drop_origin_blob(struct blame_origin *o) { - if (o->file.ptr) { - FREE_AND_NULL(o->file.ptr); - } + FREE_AND_NULL(o->file.ptr); } /* -- cgit v1.2.3