[PATCH] test, modem-helpers: remove unnecessary NULL check for g_free()

Ben Chan benchan at chromium.org
Tue Aug 28 20:10:24 UTC 2018


g_free() handles a NULL pointer properly, so there is no need to have a
NULL check before calling g_free().
---
 src/tests/test-modem-helpers.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/tests/test-modem-helpers.c b/src/tests/test-modem-helpers.c
index 483b56f5..4a044c68 100644
--- a/src/tests/test-modem-helpers.c
+++ b/src/tests/test-modem-helpers.c
@@ -3265,8 +3265,7 @@ test_cclk_response (void)
             g_assert (mm_network_timezone_get_leap_seconds (tz) == MM_NETWORK_TIMEZONE_LEAP_SECONDS_UNKNOWN);
         }
 
-        if (iso8601)
-            g_free (iso8601);
+        g_free (iso8601);
 
         if (tz)
             g_object_unref (tz);
-- 
2.19.0.rc0.228.g281dcd1b4d0-goog



More information about the ModemManager-devel mailing list