MFC Rev 1.15
fixed a potential memory leak Approved by: re(hrs)
This commit is contained in:
parent
1a3d568b21
commit
021e8ed5df
@ -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