winhttp: Properly destroy linked list if connection can't be opened
This commit is contained in:
@@ -358,8 +358,11 @@ METHOD(fetcher_t, set_option, bool,
|
|||||||
|
|
||||||
METHOD(fetcher_t, destroy, void,
|
METHOD(fetcher_t, destroy, void,
|
||||||
private_winhttp_fetcher_t *this)
|
private_winhttp_fetcher_t *this)
|
||||||
|
{
|
||||||
|
if (this->session)
|
||||||
{
|
{
|
||||||
WinHttpCloseHandle(this->session);
|
WinHttpCloseHandle(this->session);
|
||||||
|
}
|
||||||
this->headers->destroy_function(this->headers, free);
|
this->headers->destroy_function(this->headers, free);
|
||||||
free(this);
|
free(this);
|
||||||
}
|
}
|
||||||
@@ -389,7 +392,7 @@ winhttp_fetcher_t *winhttp_fetcher_create()
|
|||||||
|
|
||||||
if (!this->session)
|
if (!this->session)
|
||||||
{
|
{
|
||||||
free(this);
|
destroy(this);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user