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:
@@ -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)
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user