From 943e5a618b13db1d500da0d5c981e43df84f56ce Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Fri, 28 Jun 2024 11:19:15 +0300 Subject: [PATCH] searpc-demo-server: free json object to fix leak --- demo/searpc-demo-server.c | 1 + 1 file changed, 1 insertion(+) diff --git a/demo/searpc-demo-server.c b/demo/searpc-demo-server.c index 9cdad73..e37fbca 100644 --- a/demo/searpc-demo-server.c +++ b/demo/searpc-demo-server.c @@ -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) {