Skip to content

Commit

Permalink
fixes double free issue fluent#2497
Browse files Browse the repository at this point in the history
Signed-off-by: Pradeep Hiremande <16595434+phiremande@users.noreply.github.com>
  • Loading branch information
phiremande committed Aug 27, 2020
1 parent c0d8099 commit ddbab9c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/flb_upstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,14 @@ static int destroy_conn(struct flb_upstream_conn *u_conn)
#endif

if (u_conn->fd > 0) {
u_conn->fd = -1;
flb_socket_close(u_conn->fd);
}

/* remove connection from the queue */
mk_list_del(&u_conn->_head);
/* remove connection from the queue */
mk_list_del(&u_conn->_head);

u->n_connections--;
flb_free(u_conn);
u->n_connections--;
flb_free(u_conn);
}

return 0;
}
Expand Down

0 comments on commit ddbab9c

Please sign in to comment.