1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

ctdb: Use TALLOC_FREE() in a few places

We have a macro for NULLing out the pointer

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Nov  8 01:35:11 UTC 2019 on sn-devel-184
This commit is contained in:
Volker Lendecke 2019-11-07 12:12:45 +01:00 committed by Amitay Isaacs
parent 8846887a55
commit f5f89b1b99
2 changed files with 5 additions and 10 deletions

View File

@ -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,

View File

@ -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,