1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 04:46:37 +02:00

relay/api: fix memory leaks in resources "ping" and "sync"

This commit is contained in:
Sébastien Helleu
2026-02-16 18:33:03 +01:00
parent fa043644cb
commit 238f8cbc7e
2 changed files with 7 additions and 1 deletions
+1
View File
@@ -14,6 +14,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
- irc: fix unit of server option `anti_flood` from seconds to milliseconds in output of `/server listfull`
- irc: fix creation of irc.msgbuffer option without a server name
- irc: ignore self join if the channel is already joined ([#2291](https://github.com/weechat/weechat/issues/2291))
- relay/api: fix memory leaks in resources "ping" and "sync"
## Version 4.8.1 (2025-12-01)
+6 -1
View File
@@ -1056,13 +1056,15 @@ RELAY_API_PROTOCOL_CALLBACK(ping)
cJSON_CreateString ((ptr_data) ? ptr_data : ""));
relay_api_msg_send_json (client, RELAY_HTTP_200_OK, NULL, "ping", json);
cJSON_Delete (json);
cJSON_Delete (json_body);
}
else
{
relay_api_msg_send_json (client, RELAY_HTTP_204_NO_CONTENT, NULL, NULL, NULL);
}
if (json_body)
cJSON_Delete (json_body);
return RELAY_API_PROTOCOL_RC_OK;
}
@@ -1121,6 +1123,9 @@ RELAY_API_PROTOCOL_CALLBACK(sync)
relay_api_msg_send_json (client, RELAY_HTTP_204_NO_CONTENT, NULL, NULL, NULL);
if (json_body)
cJSON_Delete (json_body);
return RELAY_API_PROTOCOL_RC_OK;
}