summaryrefslogtreecommitdiff
path: root/usr.sbin/rtsold
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2006-03-24 22:27:08 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2006-03-24 22:27:08 +0000
commita8cf024125581528d401b0a0b74c019f792431e1 (patch)
treede903ae6b81834e758fb04af3c98e68b4aadd904 /usr.sbin/rtsold
parent89394212b6cf9fa13711a2cf91e4d5c307aeb8c2 (diff)
Plug leak in error path; from Alexey Dobriyan; ok ray@
Diffstat (limited to 'usr.sbin/rtsold')
-rw-r--r--usr.sbin/rtsold/if.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/rtsold/if.c b/usr.sbin/rtsold/if.c
index b421b488282..7f3661e72c2 100644
--- a/usr.sbin/rtsold/if.c
+++ b/usr.sbin/rtsold/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.18 2004/01/05 20:32:50 itojun Exp $ */
+/* $OpenBSD: if.c,v 1.19 2006/03/24 22:27:07 otto Exp $ */
/* $KAME: if.c,v 1.18 2002/05/31 10:10:03 itojun Exp $ */
/*
@@ -276,8 +276,10 @@ if_nametosdl(char *name)
return(NULL);
}
- if ((ret_sdl = malloc(sdl->sdl_len)) == NULL)
+ if ((ret_sdl = malloc(sdl->sdl_len)) == NULL) {
+ free(buf);
return(NULL);
+ }
memcpy((caddr_t)ret_sdl, (caddr_t)sdl, sdl->sdl_len);
free(buf);