Skip to content

Commit ddbab9c

Browse files
committed
fixes double free issue fluent#2497
Signed-off-by: Pradeep Hiremande <16595434+phiremande@users.noreply.github.com>
1 parent c0d8099 commit ddbab9c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/flb_upstream.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,14 @@ static int destroy_conn(struct flb_upstream_conn *u_conn)
191191
#endif
192192

193193
if (u_conn->fd > 0) {
194+
u_conn->fd = -1;
194195
flb_socket_close(u_conn->fd);
195-
}
196-
197-
/* remove connection from the queue */
198-
mk_list_del(&u_conn->_head);
196+
/* remove connection from the queue */
197+
mk_list_del(&u_conn->_head);
199198

200-
u->n_connections--;
201-
flb_free(u_conn);
199+
u->n_connections--;
200+
flb_free(u_conn);
201+
}
202202

203203
return 0;
204204
}

0 commit comments

Comments
 (0)