diff --git a/ctdb/common/ctdb_io.c b/ctdb/common/ctdb_io.c index 000f71e4c20..bf8bc73b77d 100644 --- a/ctdb/common/ctdb_io.c +++ b/ctdb/common/ctdb_io.c @@ -290,8 +290,7 @@ static void queue_io_write(struct ctdb_queue *queue) queue->out_queue_length--; talloc_free(pkt); } - talloc_free(queue->fde); - queue->fde = NULL; + TALLOC_FREE(queue->fde); queue->fd = -1; tevent_schedule_immediate(queue->im, queue->ctdb->ev, queue_dead, queue); @@ -363,8 +362,7 @@ int ctdb_queue_send(struct ctdb_queue *queue, uint8_t *data, uint32_t length) !(queue->ctdb->flags & CTDB_FLAG_TORTURE)) { ssize_t n = write(queue->fd, data, length2); if (n == -1 && errno != EAGAIN && errno != EWOULDBLOCK) { - talloc_free(queue->fde); - queue->fde = NULL; + TALLOC_FREE(queue->fde); queue->fd = -1; tevent_schedule_immediate(queue->im, queue->ctdb->ev, queue_dead, queue); @@ -430,8 +428,7 @@ int ctdb_queue_send(struct ctdb_queue *queue, uint8_t *data, uint32_t length) int ctdb_queue_set_fd(struct ctdb_queue *queue, int fd) { queue->fd = fd; - talloc_free(queue->fde); - queue->fde = NULL; + TALLOC_FREE(queue->fde); if (fd != -1) { queue->fde = tevent_add_fd(queue->ctdb->ev, queue, fd, diff --git a/ctdb/tcp/tcp_connect.c b/ctdb/tcp/tcp_connect.c index a75f35a809e..b0572881880 100644 --- a/ctdb/tcp/tcp_connect.c +++ b/ctdb/tcp/tcp_connect.c @@ -93,8 +93,7 @@ static void ctdb_node_connect_write(struct tevent_context *ev, int one = 1; int ret; - talloc_free(tnode->connect_te); - tnode->connect_te = NULL; + TALLOC_FREE(tnode->connect_te); ret = getsockopt(tnode->out_fd, SOL_SOCKET, SO_ERROR, &error, &len); if (ret != 0 || error != 0) { @@ -105,8 +104,7 @@ static void ctdb_node_connect_write(struct tevent_context *ev, return; } - talloc_free(tnode->connect_fde); - tnode->connect_fde = NULL; + TALLOC_FREE(tnode->connect_fde); ret = setsockopt(tnode->out_fd, IPPROTO_TCP,