summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Eljasiewicz <m.eljasiewic@samsung.com>2014-01-13 10:46:56 +0100
committerLubomir Rintel <lkundrak@v3.sk>2015-02-11 11:55:33 +0100
commit84a919c5b56b71b6a3009d6e4a3f952c303d5371 (patch)
tree8238535c30d653d9aed8e116d33e30b90415696f
parentae4c6fe1d022c901db5bdf43b97dd76fd06d49b0 (diff)
[Test][Daemon] Fixed memleaks
Change-Id: I672421944937773096771fc6193e267b48977245 Signed-off-by: Michal Eljasiewicz <m.eljasiewic@samsung.com>
-rw-r--r--dbus/dbus-transport.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/dbus/dbus-transport.c b/dbus/dbus-transport.c
index 38d92c41..8286041e 100644
--- a/dbus/dbus-transport.c
+++ b/dbus/dbus-transport.c
@@ -112,7 +112,7 @@ _dbus_transport_init_base (DBusTransport *transport,
DBusMessageLoader *loader;
DBusAuth *auth;
DBusCounter *counter;
- char *address_copy;
+ char *address_copy = NULL;
DBusCredentials *creds;
loader = _dbus_message_loader_new ();
@@ -140,6 +140,10 @@ _dbus_transport_init_base (DBusTransport *transport,
if (auth == NULL)
{
_dbus_message_loader_unref (loader);
+
+ if (address_copy != NULL)
+ dbus_free(address_copy);
+
return FALSE;
}
@@ -148,6 +152,10 @@ _dbus_transport_init_base (DBusTransport *transport,
{
_dbus_auth_unref (auth);
_dbus_message_loader_unref (loader);
+
+ if (address_copy != NULL)
+ dbus_free(address_copy);
+
return FALSE;
}
@@ -157,6 +165,10 @@ _dbus_transport_init_base (DBusTransport *transport,
_dbus_counter_unref (counter);
_dbus_auth_unref (auth);
_dbus_message_loader_unref (loader);
+
+ if (address_copy != NULL)
+ dbus_free(address_copy);
+
return FALSE;
}