]> git.ipfire.org Git - people/ms/strongswan.git/commitdiff
Avoid SIGSEGV during shutdown if charon is not started as root
authorTobias Brunner <tobias@strongswan.org>
Mon, 25 Jun 2012 17:00:00 +0000 (19:00 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 25 Jun 2012 17:00:00 +0000 (19:00 +0200)
src/libhydra/kernel/kernel_interface.c

index 573557506165ab4f3f5b29202b79d26e906b2de3..b6bc5d92ebfdbb6cac45b4333a01e8c4de630f12 100644 (file)
@@ -362,7 +362,7 @@ METHOD(kernel_interface_t, add_ipsec_interface, void,
 METHOD(kernel_interface_t, remove_ipsec_interface, void,
        private_kernel_interface_t *this, kernel_ipsec_constructor_t constructor)
 {
-       if (constructor == this->ipsec_constructor)
+       if (constructor == this->ipsec_constructor && this->ipsec)
        {
                this->ipsec->destroy(this->ipsec);
                this->ipsec = NULL;
@@ -382,7 +382,7 @@ METHOD(kernel_interface_t, add_net_interface, void,
 METHOD(kernel_interface_t, remove_net_interface, void,
        private_kernel_interface_t *this, kernel_net_constructor_t constructor)
 {
-       if (constructor == this->net_constructor)
+       if (constructor == this->net_constructor && this->net)
        {
                this->net->destroy(this->net);
                this->net = NULL;