1
0
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:
Sébastien Helleu
2024-04-25 19:59:56 +02:00
parent 42cba25453
commit ba97a39565
3 changed files with 7 additions and 2 deletions
@@ -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;
}
+3
View File
@@ -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);
}
/*