fixed a potential memory leak
Obtained from: KAME MFC after: 1 day
This commit is contained in:
parent
256c62e23f
commit
4b8b545e4b
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user