From 6e6824e4bcd845d2681902b69bf6bd16809bbc05 Mon Sep 17 00:00:00 2001 From: suz Date: Sat, 20 Sep 2003 09:41:13 +0000 Subject: [PATCH] fixed memory leak. Obtained From: KAME --- usr.sbin/rtadvd/if.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.sbin/rtadvd/if.c b/usr.sbin/rtadvd/if.c index a6517f248ca3..07d9e1f74b2c 100644 --- a/usr.sbin/rtadvd/if.c +++ b/usr.sbin/rtadvd/if.c @@ -128,8 +128,11 @@ if_nametosdl(char *name) } if ((ret_sdl = malloc(sdl->sdl_len)) == NULL) - return(NULL); + goto end; memcpy((caddr_t)ret_sdl, (caddr_t)sdl, sdl->sdl_len); + +end: + free(buf); return(ret_sdl); }