mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-21 11:42:56 +03:00
HTTP Auth: Squash error path leaks.
This commit is contained in:
parent
097f8dcde5
commit
9c29935f3c
@ -146,6 +146,8 @@ static nserror netsurf__unpack_userpass(
|
||||
username = malloc(1);
|
||||
password = malloc(1);
|
||||
if (username == NULL || password == NULL) {
|
||||
free(username);
|
||||
free(password);
|
||||
return NSERROR_NOMEM;
|
||||
}
|
||||
username[0] = '\0';
|
||||
@ -167,6 +169,8 @@ static nserror netsurf__unpack_userpass(
|
||||
username = malloc(len + 1);
|
||||
password = malloc(len2 + 1);
|
||||
if (username == NULL || password == NULL) {
|
||||
free(username);
|
||||
free(password);
|
||||
return NSERROR_NOMEM;
|
||||
}
|
||||
memcpy(username, userpass, len);
|
||||
|
Loading…
Reference in New Issue
Block a user