]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
charon-xpc: Properly xpc_retain() connections we xpc_release()
authorMartin Willi <martin@revosec.ch>
Mon, 28 Oct 2013 13:29:07 +0000 (14:29 +0100)
committerMartin Willi <martin@revosec.ch>
Mon, 28 Oct 2013 13:51:40 +0000 (14:51 +0100)
src/frontends/osx/charon-xpc/xpc_channels.c
src/frontends/osx/charon-xpc/xpc_dispatch.c

index 05913a784d28cb539edc04b6bdb7730df00e9e50..5e9366bf5483628640c70b23ff68774216799dde 100644 (file)
@@ -211,6 +211,7 @@ METHOD(xpc_channels_t, add, void,
                .logger = xpc_logger_create(conn),
        );
 
+       xpc_retain(entry->conn);
        xpc_connection_set_event_handler(entry->conn, ^(xpc_object_t event)
        {
                if (event == XPC_ERROR_CONNECTION_INVALID ||
index df9126c8b0b4462d1c8ec34ec911ed694764afd9..dd7ce1531ec0be3cd12c44188caabf0d1218da49 100644 (file)
@@ -281,6 +281,7 @@ static void cleanup_connection(private_xpc_dispatch_t *this)
  */
 static void set_handler(private_xpc_dispatch_t *this)
 {
+       xpc_retain(this->service);
        xpc_connection_set_event_handler(this->service, ^(xpc_object_t conn)
        {
                xpc_connection_set_event_handler(conn, ^(xpc_object_t event)