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