]> git.proxmox.com Git - mirror_frr.git/commitdiff
nhrpd: Fix crash in 'no nhrp event socket..' command
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 17 May 2017 22:31:02 +0000 (18:31 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 17 May 2017 22:31:02 +0000 (18:31 -0400)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
nhrpd/nhrp_event.c

index da86c585a4816c5a6302edc6595a95afe073a705..8a3f820f766f4cfe6d81246bc7d2eb151d55fa6c 100644 (file)
@@ -215,9 +215,12 @@ void evmgr_init(void)
 
 void evmgr_set_socket(const char *socket)
 {
-       if (nhrp_event_socket_path)
+       if (nhrp_event_socket_path) {
                free((char *) nhrp_event_socket_path);
-       nhrp_event_socket_path = strdup(socket);
+               nhrp_event_socket_path = NULL;
+       }
+       if (socket)
+               nhrp_event_socket_path = strdup(socket);
        evmgr_connection_error(&evmgr_connection);
 }