From 789c4881ed5ebab0af2a8a5841e3b59f85bcd531 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Mon, 1 Dec 2008 10:50:29 +0100 Subject: [PATCH] free structure on error. Closes Coverity #76 --- src/main/listen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/listen.c b/src/main/listen.c index 1e07e4f..1e4926f 100644 --- a/src/main/listen.c +++ b/src/main/listen.c @@ -1559,13 +1559,14 @@ int listen_init(CONF_SECTION *config, rad_listen_t **head) if (!sock->clients) { cf_log_err(cf_sectiontoitem(config), "Failed to find any clients for this listen section"); + listen_free(&this); return -1; } if (listen_bind(this) < 0) { - listen_free(&this); listen_free(head); radlog(L_ERR, "There appears to be another RADIUS server running on the authentication port %d", sock->port); + listen_free(&this); return -1; } auth_port = sock->port; /* may have been updated in listen_bind */ -- 2.1.4