diff options
author | Simo Sorce <idra@samba.org> | 2008-12-09 16:15:18 -0500 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2008-12-09 16:48:45 -0500 |
commit | dd42f1e418addaedbeeff9602520288edf3c7108 (patch) | |
tree | 2f176cc7ba2dc26e93fd844b9c0e40484a2ed0d8 /server/providers | |
parent | 8f86577722f9e880c82e7a98fcb14ee06acb7170 (diff) | |
download | sssd-dd42f1e418addaedbeeff9602520288edf3c7108.tar.gz sssd-dd42f1e418addaedbeeff9602520288edf3c7108.tar.xz sssd-dd42f1e418addaedbeeff9602520288edf3c7108.zip |
Fix dbus related memory leaks
Diffstat (limited to 'server/providers')
-rw-r--r-- | server/providers/data_provider.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/server/providers/data_provider.c b/server/providers/data_provider.c index 181e865ab..3bd0ef59d 100644 --- a/server/providers/data_provider.c +++ b/server/providers/data_provider.c @@ -243,6 +243,7 @@ static int dbus_dp_init(struct sbus_conn_ctx *conn_ctx, void *data) */ DEBUG(0, ("D-BUS send failed.\n")); talloc_free(conn_ctx); + dbus_message_unref(msg); return EIO; } @@ -282,7 +283,7 @@ static void identity_check(DBusPendingCall *pending, void *data) /* Destroy this connection */ sbus_disconnect(dpcli->conn_ctx); - return; + goto done; } type = dbus_message_get_type(reply); @@ -297,7 +298,7 @@ static void identity_check(DBusPendingCall *pending, void *data) if (!ret) { DEBUG(1,("Failed, to parse message, killing connection\n")); sbus_disconnect(dpcli->conn_ctx); - return; + goto done; } switch (cli_type && DP_CLI_TYPE_MASK) { @@ -306,7 +307,7 @@ static void identity_check(DBusPendingCall *pending, void *data) if (!dpbe) { DEBUG(0, ("Out of memory!\n")); sbus_disconnect(dpcli->conn_ctx); - return; + goto done; } dpbe->name = talloc_strdup(dpbe, cli_name); @@ -314,7 +315,7 @@ static void identity_check(DBusPendingCall *pending, void *data) if (!dpbe->name || !dpbe->domain) { DEBUG(0, ("Out of memory!\n")); sbus_disconnect(dpcli->conn_ctx); - return; + goto done; } dpbe->dpcli = dpcli; @@ -329,14 +330,14 @@ static void identity_check(DBusPendingCall *pending, void *data) if (!dpfe) { DEBUG(0, ("Out of memory!\n")); sbus_disconnect(dpcli->conn_ctx); - return; + goto done; } dpfe->name = talloc_strdup(dpfe, cli_name); if (!dpfe->name) { DEBUG(0, ("Out of memory!\n")); sbus_disconnect(dpcli->conn_ctx); - return; + goto done; } dpfe->dpcli = dpcli; @@ -349,7 +350,7 @@ static void identity_check(DBusPendingCall *pending, void *data) default: DEBUG(1, ("Unknown client type, killing connection\n")); sbus_disconnect(dpcli->conn_ctx); - return; + goto done; } /* Set up the destructor for this service */ @@ -368,8 +369,11 @@ static void identity_check(DBusPendingCall *pending, void *data) * We'll destroy it now. */ sbus_disconnect(dpcli->conn_ctx); - return; } + +done: + dbus_pending_call_unref(pending); + dbus_message_unref(reply); } static void online_check(DBusPendingCall *pending, void *data) |