1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 14:26:39 +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 0987e12e83
commit 113f72f70e
2 changed files with 7 additions and 1 deletions
+1
View File
@@ -11,6 +11,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
### Fixed
- 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;
}