Fix resource leak
[platform/upstream/connman.git] / src / timeserver.c
index 32f1b01..a9a73a2 100755 (executable)
@@ -106,9 +106,11 @@ static void resolv_result(GResolvResultStatus status, char **results,
        server = g_strdup((gchar *)user_data);
        ts_list = g_slist_append(ts_list, server);
 
-       DBG("added server %s", server);
-#endif
+       if (!simplified_log)
+               DBG("added server %s", server);
 
+       if (!simplified_log)
+#endif
        DBG("status %d", status);
 
        if (status == G_RESOLV_RESULT_STATUS_SUCCESS) {
@@ -185,7 +187,9 @@ static void sync_next(void)
                        __connman_ntp_start(ts_current, ntp_callback, NULL);
                        return;
                }
-
+#if defined TIZEN_EXT
+       if (!simplified_log)
+#endif
                DBG("Resolving timeserver %s", ts_current);
 #if defined TIZEN_EXT
                resolv_id = g_resolv_lookup_hostname(resolv, ts_current,
@@ -342,7 +346,7 @@ static void ts_recheck_enable(void)
 }
 
 /*
- * This function must be called everytime the default service changes, the
+ * This function must be called every time the default service changes, the
  * service timeserver(s) or gateway changes or the global timeserver(s) changes.
  */
 int __connman_timeserver_sync(struct connman_service *default_service)