From 0bee989d8acd1346993cf8f39a3b182a2cb2eecc Mon Sep 17 00:00:00 2001 From: Daniel Collins Date: Sat, 21 Aug 2021 12:04:59 +0100 Subject: [PATCH] Fix memory leak. --- src/interface.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/interface.c b/src/interface.c index 6bff6ec..ec1fbae 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1,5 +1,5 @@ /* IPXWrapper - Interface functions - * Copyright (C) 2011 Daniel Collins + * Copyright (C) 2011-2021 Daniel Collins * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published by @@ -232,6 +232,7 @@ ipx_interface_t *load_ipx_interfaces(void) if(!(wc_iface = _new_iface(wc_config.netnum, wc_config.nodenum))) { + free(ifroot); return NULL; } @@ -249,6 +250,7 @@ ipx_interface_t *load_ipx_interfaces(void) if(wc_iface && !_push_addr(wc_iface, &(ifptr->IpAddressList))) { free_ipx_interface_list(&nics); + free(ifroot); return NULL; } @@ -262,6 +264,7 @@ ipx_interface_t *load_ipx_interfaces(void) if(!iface) { free_ipx_interface_list(&nics); + free(ifroot); return NULL; } @@ -279,6 +282,7 @@ ipx_interface_t *load_ipx_interfaces(void) if(!_push_addr(iface, &(ifptr->IpAddressList))) { free_ipx_interface_list(&nics); + free(ifroot); return NULL; } }