1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 11:13:12 +02:00

relay: remove check of NULL pointers before calling free() (issue #865)

This commit is contained in:
Sébastien Helleu
2024-04-24 23:46:57 +02:00
parent b138510cff
commit 7ee57af8e3
17 changed files with 136 additions and 272 deletions
+2 -4
View File
@@ -206,8 +206,7 @@ relay_api_msg_send_json_internal (struct t_relay_client *client,
string,
(string) ? strlen (string) : 0,
NULL); /* raw_message */
if (string)
free (string);
free (string);
cJSON_DetachItemFromObject (json, "body");
cJSON_Delete (json);
}
@@ -217,8 +216,7 @@ relay_api_msg_send_json_internal (struct t_relay_client *client,
string = (json_body) ? cJSON_PrintUnformatted (json_body) : NULL;
num_bytes = relay_http_send_json (client, return_code, message, headers,
string);
if (string)
free (string);
free (string);
}
return num_bytes;