summaryrefslogtreecommitdiff
path: root/desktop/netsurf.c
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2018-08-15 11:11:54 +0100
committerMichael Drake <michael.drake@codethink.co.uk>2018-08-15 11:11:54 +0100
commit9c29935f3ca274d002517ed09e17921e42dbaf21 (patch)
treec752ee1c28a46e387a64b32663eb54e63f727e8b /desktop/netsurf.c
parent097f8dcde5c212d91bf25ed9256860cb2b8bfa3d (diff)
downloadnetsurf-9c29935f3ca274d002517ed09e17921e42dbaf21.tar.gz
netsurf-9c29935f3ca274d002517ed09e17921e42dbaf21.tar.bz2
HTTP Auth: Squash error path leaks.
Diffstat (limited to 'desktop/netsurf.c')
-rw-r--r--desktop/netsurf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/desktop/netsurf.c b/desktop/netsurf.c
index 3757a2a34..8785a98a8 100644
--- a/desktop/netsurf.c
+++ b/desktop/netsurf.c
@@ -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);