1
0
mirror of https://github.com/haiwen/libsearpc.git synced 2025-08-02 05:12:55 +00:00

searpc-demo-server: free json object to fix leak

This commit is contained in:
Stas Sergeev 2024-06-28 11:19:15 +03:00
parent 949917cb6c
commit 943e5a618b

View File

@ -151,6 +151,7 @@ main(int argc, char *argv[])
pac_ret = (packet *)buf;
pac_ret->length = htons((uint16_t)ret_len);
memcpy(pac_ret->data, res, ret_len);
free(res);
/* send the ret packet */
if (writen (connfd, buf, PACKET_HEADER_LENGTH + ret_len) == -1) {