From 9c29935f3ca274d002517ed09e17921e42dbaf21 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 15 Aug 2018 11:11:54 +0100 Subject: HTTP Auth: Squash error path leaks. --- desktop/netsurf.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'desktop') 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); -- cgit v1.2.3