summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2012-10-17 07:46:14 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-10-17 09:19:29 (GMT)
commit45d78b9b12b6242d40a3e65fd8ada7be1329e1e6 (patch)
tree835f690ac85307cf4c615ebb2da89be883a779e1
parent9f03ec3e6b54222a5d7f9993e8543d6699c15f89 (diff)
downloadconnman-45d78b9b12b6242d40a3e65fd8ada7be1329e1e6.zip
connman-45d78b9b12b6242d40a3e65fd8ada7be1329e1e6.tar.gz
connman-45d78b9b12b6242d40a3e65fd8ada7be1329e1e6.tar.bz2
client: Fix various memory leaks in monitor and services parts
-rw-r--r--client/monitor.c5
-rw-r--r--client/services.c10
2 files changed, 13 insertions, 2 deletions
diff --git a/client/monitor.c b/client/monitor.c
index 3c3ca5c..d2f8846 100644
--- a/client/monitor.c
+++ b/client/monitor.c
@@ -164,6 +164,9 @@ DBusHandlerResult service_property_changed(DBusConnection *connection,
if (dbus_message_is_signal(message, "net.connman.Service",
"PropertyChanged")) {
service_message = get_message(connection, "GetServices");
+ if (service_message == NULL)
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
service.name = get_service_name(service_message,
(char *) dbus_message_get_path(message));
printf("\n");
@@ -172,6 +175,8 @@ DBusHandlerResult service_property_changed(DBusConnection *connection,
dbus_message_get_interface(message),
service.name);
extract_signal_args(message);
+
+ dbus_message_unref(service_message);
}
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
diff --git a/client/services.c b/client/services.c
index a7dfe36..e4f177c 100644
--- a/client/services.c
+++ b/client/services.c
@@ -408,8 +408,10 @@ int set_proxy_manual(DBusConnection *connection, DBusMessage *message,
"net.connman.Service",
"SetProperty");
- if (message_send == NULL)
+ if (message_send == NULL) {
+ g_free(path);
return -ENOMEM;
+ }
dbus_message_iter_init_append(message_send, &iter);
dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &property);
@@ -443,6 +445,8 @@ int set_proxy_manual(DBusConnection *connection, DBusMessage *message,
dbus_connection_flush(connection);
dbus_message_unref(message_send);
+ g_free(path);
+
return 0;
}
@@ -465,8 +469,10 @@ int set_service_property(DBusConnection *connection, DBusMessage *message,
"net.connman.Service",
"SetProperty");
- if (message_send == NULL)
+ if (message_send == NULL) {
+ g_free(path);
return -ENOMEM;
+ }
dbus_message_iter_init_append(message_send, &iter);