Fix memory leak in HTTP library.

git-svn-id: svn://kolibrios.org@5904 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2015-11-09 21:47:39 +00:00
parent 4f66bc4c19
commit 82ee194a2b

View File

@ -1473,6 +1473,7 @@ endl
jnz .error1
; getaddrinfo returns addrinfo struct, make the pointer to sockaddr struct
push esi ; for freeaddrinfo
mov esi, [esi + addrinfo.ai_addr]
mov [sockaddr], esi
mov eax, [esi + sockaddr_in.sin_addr]
@ -1501,18 +1502,13 @@ endl
DEBUGF 1, "Socket is now connected.\n"
; free allocated memory
push [sockaddr]
call [freeaddrinfo]
mov eax, [socketnum]
ret
.error2:
; free allocated memory
push [sockaddr]
call [freeaddrinfo]
.error1:
xor eax, eax
ret