fixed memory leak.
Obtained From: KAME
This commit is contained in:
parent
bcf5e4d6b1
commit
f9547841bc
@ -128,8 +128,11 @@ if_nametosdl(char *name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((ret_sdl = malloc(sdl->sdl_len)) == NULL)
|
if ((ret_sdl = malloc(sdl->sdl_len)) == NULL)
|
||||||
return(NULL);
|
goto end;
|
||||||
memcpy((caddr_t)ret_sdl, (caddr_t)sdl, sdl->sdl_len);
|
memcpy((caddr_t)ret_sdl, (caddr_t)sdl, sdl->sdl_len);
|
||||||
|
|
||||||
|
end:
|
||||||
|
free(buf);
|
||||||
return(ret_sdl);
|
return(ret_sdl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user