aboutsummaryrefslogtreecommitdiffstats
path: root/sap
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2011-03-28 16:08:35 +0300
committerJohan Hedberg <johan.hedberg@nokia.com>2011-03-28 16:08:35 +0300
commit65ee36570563c84abffc6e83851adf865662f81b (patch)
tree6c027f77cded3d707ecffa7fe381a77dcd4e5a86 /sap
parent3b9b74994686644d55b861ccc0999597fda835e6 (diff)
downloadbluez-65ee36570563c84abffc6e83851adf865662f81b.tar.gz
bluez-65ee36570563c84abffc6e83851adf865662f81b.tar.xz
bluez-65ee36570563c84abffc6e83851adf865662f81b.zip
Fix SAP server double-free during unregistration
Diffstat (limited to 'sap')
-rw-r--r--sap/server.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sap/server.c b/sap/server.c
index 35abffbb..8178f1cd 100644
--- a/sap/server.c
+++ b/sap/server.c
@@ -1317,6 +1317,7 @@ static void server_free(struct sap_server *server)
sap_conn_remove(server->conn);
g_free(server->path);
g_free(server);
+ server = NULL;
}
static void destroy_sap_interface(void *data)
@@ -1395,7 +1396,6 @@ server_err:
remove_record_from_server(server->record_id);
sdp_err:
server_free(server);
- server = NULL;
sap_exit();
return -1;
@@ -1419,8 +1419,6 @@ int sap_server_unregister(const char *path)
g_dbus_unregister_interface(connection, path, SAP_SERVER_INTERFACE);
- server_free(server);
- server = NULL;
sap_exit();
return 0;