MFC Rev 1.15

fixed a potential memory leak

Approved by: re(hrs)
This commit is contained in:
suz 2006-03-29 21:06:50 +00:00
parent 1a3d568b21
commit 021e8ed5df

View File

@ -277,8 +277,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);