mirror of
https://github.com/weechat/weechat.git
synced 2026-07-06 09:43:13 +02:00
relay: remove check of NULL pointers before calling relay_http_response_free() (issue #865)
This commit is contained in:
@@ -227,8 +227,7 @@ error:
|
||||
(msg_resp_error) ? " (" : "",
|
||||
(msg_resp_error) ? msg_resp_error : "",
|
||||
(msg_resp_error) ? ")" : "");
|
||||
if (http_resp)
|
||||
relay_http_response_free (http_resp);
|
||||
relay_http_response_free (http_resp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1579,6 +1579,9 @@ relay_http_parse_response (const char *data)
|
||||
void
|
||||
relay_http_response_free (struct t_relay_http_response *response)
|
||||
{
|
||||
if (!response)
|
||||
return;
|
||||
|
||||
free (response->http_version);
|
||||
free (response->message);
|
||||
weechat_hashtable_free (response->headers);
|
||||
|
||||
@@ -1041,6 +1041,9 @@ TEST(RelayHttp, ResponseAllocFree)
|
||||
POINTERS_EQUAL(NULL, response->body);
|
||||
|
||||
relay_http_response_free (response);
|
||||
|
||||
/* test free of NULL response */
|
||||
relay_http_response_free (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user