Fix coverity issue
[platform/core/telephony/libtapi.git] / src / tapi_common.c
index 50d136d..62e91a6 100644 (file)
@@ -1529,8 +1529,10 @@ EXPORT_API char **tel_get_cp_name_list(void)
                        "org.tizen.telephony.Manager", "GetModems", NULL, NULL,
                        G_DBUS_CALL_FLAGS_NONE, TAPI_DEFAULT_TIMEOUT, NULL, &error);
        if (!rst) {
-               err("GetModems() failed. (%s)", error->message);
-               g_error_free(error);
+               if (error) {
+                       err("GetModems() failed. (%s)", error->message);
+                       g_error_free(error);
+               }
                goto OUT;
        }