Avoid a segmentation fault if opening the Android control socket failed.
authorTobias Brunner <tobias@strongswan.org>
Tue, 22 Jun 2010 14:18:22 +0000 (16:18 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 22 Jun 2010 14:18:22 +0000 (16:18 +0200)
src/libcharon/plugins/android/android_plugin.c

index 8d3a151..0e7e950 100644 (file)
@@ -64,10 +64,10 @@ METHOD(plugin_t, destroy, void,
                                                                          &this->handler->handler);
        charon->credentials->remove_set(charon->credentials, &this->creds->set);
        charon->bus->remove_listener(charon->bus, &this->logger->listener);
-       this->service->destroy(this->service);
        this->creds->destroy(this->creds);
        this->handler->destroy(this->handler);
        this->logger->destroy(this->logger);
+       DESTROY_IF(this->service);
        free(this);
 }