mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix memory leak in getlogin_r(3).
This commit is contained in:
parent
5c58b65546
commit
140dfe22fc
1 changed files with 1 additions and 1 deletions
|
@ -39,7 +39,7 @@ extern "C" int getlogin_r(char* buf, size_t size)
|
|||
do
|
||||
{
|
||||
size_t new_pwdbuflen = pwdbuflen ? 2 * pwdbuflen : 64;
|
||||
char* new_pwdbuf = pwdbuf = (char*) realloc(pwdbuf, new_pwdbuflen);
|
||||
char* new_pwdbuf = (char*) realloc(pwdbuf, new_pwdbuflen);
|
||||
if ( !new_pwdbuf )
|
||||
return free(pwdbuf), -1;
|
||||
pwdbuf = new_pwdbuf;
|
||||
|
|
Loading…
Add table
Reference in a new issue