Skip to content

Commit d0887a8

Browse files
committed
http_server: fix leak on exit on main end-point
Signed-off-by: Eduardo Silva <[email protected]>
1 parent 15f6a9e commit d0887a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/http_server/flb_hs_endpoints.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static int endpoint_root(struct flb_hs *hs)
9797
out_buf = flb_msgpack_raw_to_json_sds(mp_sbuf.data, mp_sbuf.size);
9898
msgpack_sbuffer_destroy(&mp_sbuf);
9999

100-
if (out_buf == 0) {
100+
if (out_buf) {
101101
hs->ep_root_buf = out_buf;
102102
hs->ep_root_size = flb_sds_len(out_buf);
103103
}
@@ -115,7 +115,7 @@ int flb_hs_endpoints(struct flb_hs *hs)
115115
int flb_hs_endpoints_free(struct flb_hs *hs)
116116
{
117117
if (hs->ep_root_buf) {
118-
flb_free(hs->ep_root_buf);
118+
flb_sds_destroy(hs->ep_root_buf);
119119
}
120120

121121
return 0;

0 commit comments

Comments
 (0)