]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
error-notify: fix error handling when creating the socket fails
authorMartin Willi <martin@revosec.ch>
Mon, 8 Jul 2013 08:39:23 +0000 (10:39 +0200)
committerMartin Willi <martin@revosec.ch>
Thu, 18 Jul 2013 14:00:30 +0000 (16:00 +0200)
src/libcharon/plugins/error_notify/error_notify_plugin.c

index 9ee3ed69f51bf021e97ff2d5640e1cd8eaadb131..ef0ce7bc6004c089a285fe44926330bac44e05e0 100644 (file)
@@ -109,6 +109,12 @@ plugin_t *error_notify_plugin_create()
                .socket = error_notify_socket_create(),
        );
 
+       if (!this->socket)
+       {
+               free(this);
+               return NULL;
+       }
+
        this->listener = error_notify_listener_create(this->socket);
 
        return &this->public.plugin;