[PATCH] qmi-firmware-update: remove unnecessary NULL checks for g_match_info_free

Ben Chan benchan at chromium.org
Thu Oct 18 06:11:09 UTC 2018


g_match_info_free() already check if the given pointer is NULL and does
nothing on a NULL pointer.
---
 src/qmi-firmware-update/qfu-utils.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/qmi-firmware-update/qfu-utils.c b/src/qmi-firmware-update/qfu-utils.c
index 035e78f..7a74f91 100644
--- a/src/qmi-firmware-update/qfu-utils.c
+++ b/src/qmi-firmware-update/qfu-utils.c
@@ -207,8 +207,7 @@ qfu_utils_parse_cwe_version_string (const gchar  *version,
     result = TRUE;
 
 out:
-    if (match_info)
-        g_match_info_free (match_info);
+    g_match_info_free (match_info);
     g_regex_unref (regex);
 
     return result;
-- 
2.19.1.568.g152ad8e336-goog



More information about the libqmi-devel mailing list