From d258c885bdc4e4a8141668fd94db1e24b5b8588a Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 17 May 2017 18:31:02 -0400 Subject: nhrpd: Fix crash in 'no nhrp event socket..' command Signed-off-by: Donald Sharp --- nhrpd/nhrp_event.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'nhrpd/nhrp_event.c') diff --git a/nhrpd/nhrp_event.c b/nhrpd/nhrp_event.c index da86c585a..8a3f820f7 100644 --- a/nhrpd/nhrp_event.c +++ b/nhrpd/nhrp_event.c @@ -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); } -- cgit v1.2.3