From 012aef073461fd24a901d7a8742532093b7f6ae5 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 26 Aug 2015 14:02:53 +0200 Subject: maint: avoid useless "if (foo) free(foo)" pattern My Coccinelle semantic patch finds a few more, because it also fixes up the equally pointless conditional if (foo) { free(foo); foo = NULL; } Result (feel free to squash it into your patch): Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- tests/test-hbitmap.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/test-hbitmap.c b/tests/test-hbitmap.c index 161eeb496d..abcea0cda6 100644 --- a/tests/test-hbitmap.c +++ b/tests/test-hbitmap.c @@ -139,10 +139,8 @@ static void hbitmap_test_teardown(TestHBitmapData *data, hbitmap_free(data->hb); data->hb = NULL; } - if (data->bits) { - g_free(data->bits); - data->bits = NULL; - } + g_free(data->bits); + data->bits = NULL; } /* Set a range in the HBitmap and in the shadow "simple" bitmap. -- cgit v1.2.3