downstream: fixed a leak on unsuccessful bind attempt
@@ -155,6 +155,8 @@ struct flb_downstream *flb_downstream_create(int transport, int flags,
flb_errno();
}
else {
+ stream->base.dynamically_allocated = FLB_TRUE;
+
result = flb_downstream_setup(stream,
transport, flags,
host, port,
@@ -167,9 +169,6 @@ struct flb_downstream *flb_downstream_create(int transport, int flags,
stream = NULL;
}
- else {
- stream->base.dynamically_allocated = FLB_TRUE;
- }
}
return stream;
