Skip to content

Commit 6d54d88

Browse files
committed
plugin_proxy: Plug a memory leak
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent 8d4db49 commit 6d54d88

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/flb_plugin_proxy.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,10 +694,22 @@ int flb_proxy_custom_cb_exit(void *custom_context,
694694
int ret = -1;
695695
struct flb_plugin_proxy_context *ctx = custom_context;
696696
struct flb_plugin_proxy *proxy = (ctx->proxy);
697+
struct flb_plugin_proxy_def *def;
697698
if (!custom_context) {
698699
return ret;
699700
}
700701

702+
if (!proxy) {
703+
return ret;
704+
}
705+
706+
def = proxy->def;
707+
if (def->name != NULL) {
708+
flb_free(def->name);
709+
710+
def->name = NULL;
711+
}
712+
701713
if (proxy->def->proxy == FLB_PROXY_GOLANG) {
702714
#ifdef FLB_HAVE_PROXY_GO
703715
ret = proxy_go_custom_destroy(ctx);

0 commit comments

Comments
 (0)