[PATCH] test, modem-helpers: remove unnecessary NULL check for g_free()
Aleksander Morgado
aleksander at aleksander.es
Wed Aug 29 06:36:06 UTC 2018
On Tue, Aug 28, 2018 at 10:10 PM, Ben Chan <benchan at chromium.org> wrote:
> g_free() handles a NULL pointer properly, so there is no need to have a
> NULL check before calling g_free().
> ---
Pushed, thanks
> 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
>
--
Aleksander
https://aleksander.es
More information about the ModemManager-devel
mailing list