prevent a potential resource leak, not found by coverity (perhaps masked by previous)
This commit is contained in:
parent
3713fec029
commit
6ff40a4cfb
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if.c,v 1.14 2006/03/18 21:35:35 dan Exp $ */
|
||||
/* $NetBSD: if.c,v 1.15 2006/03/18 21:41:23 dan Exp $ */
|
||||
/* $KAME: if.c,v 1.18 2002/05/31 10:10:03 itojun Exp $ */
|
||||
|
||||
/*
|
||||
@ -275,8 +275,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);
|
||||
|
Loading…
Reference in New Issue
Block a user