The branch, master has been updated via e8dba19 ctdb-server: Only set destructor if required via 134223e ctdb-server: Add goto tag avoiding code duplication via 7248b82 ctdb-server: Minor code cleanup via 423d7e2 ctdb-server: Replace the variable rc by something meaningful via b40bcb0 ctdb-server: Only talloc_set_destructor when required via 3269cd6 ctdb-server: Cleanup ctdb_daemon_call_send_remote via a2f2bf9 ctdb: Use talloc_zero instead of zeroing attributes via d6a9dc6 ctdb: Use provided mem_ctx for newly allocated memory via aba3d50 ctdb: Fixing possible memory leak in ctdb_tcp_read_cb via 611c9a0 ctdb: Fixing memory leak in ctdb_tcp_tnode_cb via 22299f9 ctdb: Fixing possible memory leak in ctdb_daemon_read_cb from 3ffc918 s4:torture: kernel oplocks. Fix assertion warning
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit e8dba1908b34831944c1788de54abff1a5cf510d Author: Swen Schillig <s...@vnet.ibm.com> Date: Thu Feb 8 12:19:09 2018 +0100 ctdb-server: Only set destructor if required Set the detructor in ctdb_start_revoke_ro_record after the revokechild_handle was added to the list. Signed-off-by: Swen Schillig <s...@vnet.ibm.com> Reviewed-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Jeremy Allison <j...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Sat Mar 31 03:45:51 CEST 2018 on sn-devel-144 commit 134223e4db52730e7a5dd059a815ece8bd4b6c41 Author: Swen Schillig <s...@vnet.ibm.com> Date: Thu Feb 8 12:08:45 2018 +0100 ctdb-server: Add goto tag avoiding code duplication Introduced err_out goto tag to prevent code duplication. Signed-off-by: Swen Schillig <s...@vnet.ibm.com> Reviewed-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Jeremy Allison <j...@samba.org> commit 7248b82e56ad4009c5d5d91ce27af82ccd97bc33 Author: Swen Schillig <s...@vnet.ibm.com> Date: Thu Feb 8 11:57:23 2018 +0100 ctdb-server: Minor code cleanup Cleanup ctdb_start_revoke_ro_record to improve readability. Signed-off-by: Swen Schillig <s...@vnet.ibm.com> Reviewed-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Jeremy Allison <j...@samba.org> commit 423d7e2460be16d0a66231d0e5b1c84d90ba5fe4 Author: Swen Schillig <s...@vnet.ibm.com> Date: Wed Jan 31 13:06:30 2018 +0100 ctdb-server: Replace the variable rc by something meaningful Replace the varibale name "rc" in ctdb_start_revoke_ro_record to prevent a mix-up with the common meaning of rc (return code). Signed-off-by: Swen Schillig <s...@vnet.ibm.com> Reviewed-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Jeremy Allison <j...@samba.org> commit b40bcb094d6aae00cae1b64a25ad3cdb39208449 Author: Swen Schillig <s...@vnet.ibm.com> Date: Tue Feb 20 17:08:59 2018 +0100 ctdb-server: Only talloc_set_destructor when required The destructor is only needed once the state got added to the DLIST. Therefore, move the setting of the destructor to after the addition of state to the DLIST. Signed-off-by: Swen Schillig <s...@vnet.ibm.com> Reviewed-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Jeremy Allison <j...@samba.org> commit 3269cd67078ec28d72168e1a98ef4329243ffa7e Author: Swen Schillig <s...@vnet.ibm.com> Date: Thu Feb 8 11:33:08 2018 +0100 ctdb-server: Cleanup ctdb_daemon_call_send_remote Minor code cleanup and adding a temporary variable to improve readabilty. Signed-off-by: Swen Schillig <s...@vnet.ibm.com> Reviewed-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Jeremy Allison <j...@samba.org> commit a2f2bf9e9706bc47c3d26ae40b7bb9658b8a9fa5 Author: Swen Schillig <s...@vnet.ibm.com> Date: Wed Feb 21 13:52:11 2018 +0100 ctdb: Use talloc_zero instead of zeroing attributes Zero entire structure with talloc_zero on memory allocation instead of setting each attribute individually. Signed-off-by: Swen Schillig <s...@vnet.ibm.com> Reviewed-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Jeremy Allison <j...@samba.org> commit d6a9dc6e249fc1785a3b6e00bdee555f439b5d24 Author: Swen Schillig <s...@vnet.ibm.com> Date: Wed Feb 21 13:34:28 2018 +0100 ctdb: Use provided mem_ctx for newly allocated memory ctdb_call_local is called with a mem_ctx parameter which should be used for newly allocated memory. This is safe because all allocations of this context are freed before this function returns. Signed-off-by: Swen Schillig <s...@vnet.ibm.com> Reviewed-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Jeremy Allison <j...@samba.org> commit aba3d508028567ccbfe8ea986d8f2b3f48af6215 Author: Swen Schillig <s...@vnet.ibm.com> Date: Tue Mar 13 09:34:52 2018 +0100 ctdb: Fixing possible memory leak in ctdb_tcp_read_cb In case of an error condition the further processing of the data is cancelled and the callback returns. In such a scenario the data has to be free'd. Signed-off-by: Swen Schillig <s...@vnet.ibm.com> Reviewed-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Jeremy Allison <j...@samba.org> commit 611c9a0ba9472aae17a3099da20ea2d836cef84a Author: Swen Schillig <s...@vnet.ibm.com> Date: Tue Mar 13 09:42:24 2018 +0100 ctdb: Fixing memory leak in ctdb_tcp_tnode_cb It is expected by the caller(queue_process) that the callback is free'ing the memory referenced by the data pointer. Signed-off-by: Swen Schillig <s...@vnet.ibm.com> Reviewed-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Jeremy Allison <j...@samba.org> commit 22299f9898ddb84db47b5372ca3cd49c3ec4a1f5 Author: Swen Schillig <s...@vnet.ibm.com> Date: Tue Mar 13 09:06:45 2018 +0100 ctdb: Fixing possible memory leak in ctdb_daemon_read_cb In case of an error condition the further processing of the data is cancelled and the callback returns. In such a scenario the data has to be free'd. Signed-off-by: Swen Schillig <s...@vnet.ibm.com> Reviewed-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Jeremy Allison <j...@samba.org> ----------------------------------------------------------------------- Summary of changes: ctdb/client/ctdb_client.c | 5 +- ctdb/server/ctdb_call.c | 241 ++++++++++++++++++++++++++-------------------- ctdb/server/ctdb_daemon.c | 8 +- ctdb/tcp/tcp_connect.c | 1 + ctdb/tcp/tcp_io.c | 3 +- 5 files changed, 147 insertions(+), 111 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c index d399cb5..a7624b7 100644 --- a/ctdb/client/ctdb_client.c +++ b/ctdb/client/ctdb_client.c @@ -86,7 +86,7 @@ int ctdb_call_local(struct ctdb_db_context *ctdb_db, struct ctdb_call *call, struct ctdb_registered_call *fn; struct ctdb_context *ctdb = ctdb_db->ctdb; - c = talloc(ctdb, struct ctdb_call_info); + c = talloc_zero(mem_ctx, struct ctdb_call_info); CTDB_NO_MEMORY(ctdb, c); c->key = call->key; @@ -94,9 +94,6 @@ int ctdb_call_local(struct ctdb_db_context *ctdb_db, struct ctdb_call *call, c->record_data.dptr = talloc_memdup(c, data->dptr, data->dsize); c->record_data.dsize = data->dsize; CTDB_NO_MEMORY(ctdb, c->record_data.dptr); - c->new_data = NULL; - c->reply_data = NULL; - c->status = 0; c->header = header; for (fn=ctdb_db->calls;fn;fn=fn->next) { diff --git a/ctdb/server/ctdb_call.c b/ctdb/server/ctdb_call.c index 17d6f98..0305920 100644 --- a/ctdb/server/ctdb_call.c +++ b/ctdb/server/ctdb_call.c @@ -1464,6 +1464,7 @@ struct ctdb_call_state *ctdb_daemon_call_send_remote(struct ctdb_db_context *ctd uint32_t len; struct ctdb_call_state *state; struct ctdb_context *ctdb = ctdb_db->ctdb; + struct ctdb_req_call_old *c; if (ctdb->methods == NULL) { DEBUG(DEBUG_INFO,(__location__ " Failed send packet. Transport is down\n")); @@ -1477,35 +1478,43 @@ struct ctdb_call_state *ctdb_daemon_call_send_remote(struct ctdb_db_context *ctd state->reqid = reqid_new(ctdb->idr, state); state->ctdb_db = ctdb_db; - talloc_set_destructor(state, ctdb_call_destructor); - - len = offsetof(struct ctdb_req_call_old, data) + call->key.dsize + call->call_data.dsize; - state->c = ctdb_transport_allocate(ctdb, state, CTDB_REQ_CALL, len, - struct ctdb_req_call_old); - CTDB_NO_MEMORY_NULL(ctdb, state->c); - state->c->hdr.destnode = header->dmaster; - - /* this limits us to 16k outstanding messages - not unreasonable */ - state->c->hdr.reqid = state->reqid; - state->c->hdr.generation = ctdb_db->generation; - state->c->flags = call->flags; - state->c->db_id = ctdb_db->db_id; - state->c->callid = call->call_id; - state->c->hopcount = 0; - state->c->keylen = call->key.dsize; - state->c->calldatalen = call->call_data.dsize; - memcpy(&state->c->data[0], call->key.dptr, call->key.dsize); - memcpy(&state->c->data[call->key.dsize], - call->call_data.dptr, call->call_data.dsize); - *(state->call) = *call; - state->call->call_data.dptr = &state->c->data[call->key.dsize]; - state->call->key.dptr = &state->c->data[0]; - state->state = CTDB_CALL_WAIT; state->generation = ctdb_db->generation; + len = offsetof(struct ctdb_req_call_old, data) + call->key.dsize + + call->call_data.dsize; + + c = ctdb_transport_allocate(ctdb, + state, + CTDB_REQ_CALL, + len, + struct ctdb_req_call_old); + + CTDB_NO_MEMORY_NULL(ctdb, c); + state->c = c; + + c->hdr.destnode = header->dmaster; + c->hdr.reqid = state->reqid; + c->hdr.generation = ctdb_db->generation; + c->flags = call->flags; + c->db_id = ctdb_db->db_id; + c->callid = call->call_id; + c->hopcount = 0; + c->keylen = call->key.dsize; + c->calldatalen = call->call_data.dsize; + + memcpy(&c->data[0], call->key.dptr, call->key.dsize); + memcpy(&c->data[call->key.dsize], + call->call_data.dptr, + call->call_data.dsize); + + *(state->call) = *call; + state->call->call_data.dptr = &c->data[call->key.dsize]; + state->call->key.dptr = &c->data[0]; + DLIST_ADD(ctdb_db->pending_calls, state); + talloc_set_destructor(state, ctdb_call_destructor); ctdb_queue_packet(ctdb, &state->c->hdr); return state; @@ -1549,7 +1558,7 @@ struct revokechild_deferred_call { struct ctdb_req_header *hdr; deferred_requeue_fn fn; void *ctx; - struct revokechild_handle *rc; + struct revokechild_handle *rev_hdl; }; struct revokechild_handle { @@ -1583,36 +1592,36 @@ static void deferred_call_requeue(struct tevent_context *ev, static int deferred_call_destructor(struct revokechild_deferred_call *dcall) { - struct revokechild_handle *rc = dcall->rc; + struct revokechild_handle *rev_hdl = dcall->rev_hdl; - DLIST_REMOVE(rc->deferred_call_list, dcall); + DLIST_REMOVE(rev_hdl->deferred_call_list, dcall); return 0; } -static int revokechild_destructor(struct revokechild_handle *rc) +static int revokechild_destructor(struct revokechild_handle *rev_hdl) { struct revokechild_deferred_call *now_list = NULL; struct revokechild_deferred_call *delay_list = NULL; - if (rc->fde != NULL) { - talloc_free(rc->fde); + if (rev_hdl->fde != NULL) { + talloc_free(rev_hdl->fde); } - if (rc->fd[0] != -1) { - close(rc->fd[0]); + if (rev_hdl->fd[0] != -1) { + close(rev_hdl->fd[0]); } - if (rc->fd[1] != -1) { - close(rc->fd[1]); + if (rev_hdl->fd[1] != -1) { + close(rev_hdl->fd[1]); } - ctdb_kill(rc->ctdb, rc->child, SIGKILL); + ctdb_kill(rev_hdl->ctdb, rev_hdl->child, SIGKILL); - DLIST_REMOVE(rc->ctdb_db->revokechild_active, rc); + DLIST_REMOVE(rev_hdl->ctdb_db->revokechild_active, rev_hdl); - while (rc->deferred_call_list != NULL) { + while (rev_hdl->deferred_call_list != NULL) { struct revokechild_deferred_call *dcall; - dcall = rc->deferred_call_list; - DLIST_REMOVE(rc->deferred_call_list, dcall); + dcall = rev_hdl->deferred_call_list; + DLIST_REMOVE(rev_hdl->deferred_call_list, dcall); /* If revoke is successful, then first process all the calls * that need write access, and delay readonly requests by 1 @@ -1623,7 +1632,7 @@ static int revokechild_destructor(struct revokechild_handle *rc) * be recovered. */ - if (rc->status == 0) { + if (rev_hdl->status == 0) { struct ctdb_req_call_old *c; c = (struct ctdb_req_call_old *)dcall->hdr; @@ -1638,15 +1647,19 @@ static int revokechild_destructor(struct revokechild_handle *rc) } if (now_list != NULL) { - tevent_add_timer(rc->ctdb->ev, rc->ctdb_db, + tevent_add_timer(rev_hdl->ctdb->ev, + rev_hdl->ctdb_db, tevent_timeval_current_ofs(0, 0), - deferred_call_requeue, now_list); + deferred_call_requeue, + now_list); } if (delay_list != NULL) { - tevent_add_timer(rc->ctdb->ev, rc->ctdb_db, + tevent_add_timer(rev_hdl->ctdb->ev, + rev_hdl->ctdb_db, tevent_timeval_current_ofs(1, 0), - deferred_call_requeue, delay_list); + deferred_call_requeue, + delay_list); } return 0; @@ -1656,26 +1669,26 @@ static void revokechild_handler(struct tevent_context *ev, struct tevent_fd *fde, uint16_t flags, void *private_data) { - struct revokechild_handle *rc = talloc_get_type(private_data, - struct revokechild_handle); + struct revokechild_handle *rev_hdl = + talloc_get_type(private_data, struct revokechild_handle); int ret; char c; - ret = sys_read(rc->fd[0], &c, 1); + ret = sys_read(rev_hdl->fd[0], &c, 1); if (ret != 1) { DEBUG(DEBUG_ERR,("Failed to read status from revokechild. errno:%d\n", errno)); - rc->status = -1; - talloc_free(rc); + rev_hdl->status = -1; + talloc_free(rev_hdl); return; } if (c != 0) { DEBUG(DEBUG_ERR,("revokechild returned failure. status:%d\n", c)); - rc->status = -1; - talloc_free(rc); + rev_hdl->status = -1; + talloc_free(rev_hdl); return; } - talloc_free(rc); + talloc_free(rev_hdl); } struct ctdb_revoke_state { @@ -1811,19 +1824,27 @@ static int ctdb_revoke_all_delegations(struct ctdb_context *ctdb, struct ctdb_db } -int ctdb_start_revoke_ro_record(struct ctdb_context *ctdb, struct ctdb_db_context *ctdb_db, TDB_DATA key, struct ctdb_ltdb_header *header, TDB_DATA data) +int ctdb_start_revoke_ro_record(struct ctdb_context *ctdb, + struct ctdb_db_context *ctdb_db, + TDB_DATA key, + struct ctdb_ltdb_header *header, + TDB_DATA data) { TDB_DATA tdata; - struct revokechild_handle *rc; + struct revokechild_handle *rev_hdl; pid_t parent = getpid(); int ret; - header->flags &= ~(CTDB_REC_RO_REVOKING_READONLY|CTDB_REC_RO_HAVE_DELEGATIONS|CTDB_REC_RO_HAVE_READONLY); + header->flags &= ~(CTDB_REC_RO_REVOKING_READONLY | + CTDB_REC_RO_HAVE_DELEGATIONS | + CTDB_REC_RO_HAVE_READONLY); + header->flags |= CTDB_REC_FLAG_MIGRATED_WITH_DATA; header->rsn -= 1; - if ((rc = talloc_zero(ctdb_db, struct revokechild_handle)) == NULL) { - DEBUG(DEBUG_ERR,("Failed to allocate revokechild_handle\n")); + rev_hdl = talloc_zero(ctdb_db, struct revokechild_handle); + if (rev_hdl == NULL) { + D_ERR("Failed to allocate revokechild_handle\n"); return -1; } @@ -1832,96 +1853,108 @@ int ctdb_start_revoke_ro_record(struct ctdb_context *ctdb, struct ctdb_db_contex uint8_t *tmp; tmp = tdata.dptr; - tdata.dptr = talloc_memdup(rc, tdata.dptr, tdata.dsize); + tdata.dptr = talloc_memdup(rev_hdl, tdata.dptr, tdata.dsize); free(tmp); } - rc->status = 0; - rc->ctdb = ctdb; - rc->ctdb_db = ctdb_db; - rc->fd[0] = -1; - rc->fd[1] = -1; + rev_hdl->status = 0; + rev_hdl->ctdb = ctdb; + rev_hdl->ctdb_db = ctdb_db; + rev_hdl->fd[0] = -1; + rev_hdl->fd[1] = -1; - talloc_set_destructor(rc, revokechild_destructor); - - rc->key.dsize = key.dsize; - rc->key.dptr = talloc_memdup(rc, key.dptr, key.dsize); - if (rc->key.dptr == NULL) { - DEBUG(DEBUG_ERR,("Failed to allocate key for revokechild_handle\n")); - talloc_free(rc); - return -1; + rev_hdl->key.dsize = key.dsize; + rev_hdl->key.dptr = talloc_memdup(rev_hdl, key.dptr, key.dsize); + if (rev_hdl->key.dptr == NULL) { + D_ERR("Failed to allocate key for revokechild_handle\n"); + goto err_out; } - ret = pipe(rc->fd); + ret = pipe(rev_hdl->fd); if (ret != 0) { - DEBUG(DEBUG_ERR,("Failed to allocate key for revokechild_handle\n")); - talloc_free(rc); - return -1; + D_ERR("Failed to allocate key for revokechild_handle\n"); + goto err_out; } - rc->child = ctdb_fork(ctdb); - if (rc->child == (pid_t)-1) { - DEBUG(DEBUG_ERR,("Failed to fork child for revokechild\n")); - talloc_free(rc); - return -1; + rev_hdl->child = ctdb_fork(ctdb); + if (rev_hdl->child == (pid_t)-1) { + D_ERR("Failed to fork child for revokechild\n"); + goto err_out; } - if (rc->child == 0) { + if (rev_hdl->child == 0) { char c = 0; - close(rc->fd[0]); + close(rev_hdl->fd[0]); prctl_set_comment("ctdb_revokechild"); if (switch_from_server_to_client(ctdb) != 0) { - DEBUG(DEBUG_ERR,("Failed to switch from server to client for revokechild process\n")); + D_ERR("Failed to switch from server to client " + "for revokechild process\n"); c = 1; goto child_finished; } - c = ctdb_revoke_all_delegations(ctdb, ctdb_db, tdata, key, header, data); + c = ctdb_revoke_all_delegations(ctdb, + ctdb_db, + tdata, + key, + header, + data); child_finished: - sys_write(rc->fd[1], &c, 1); + sys_write(rev_hdl->fd[1], &c, 1); ctdb_wait_for_process_to_exit(parent); _exit(0); } - close(rc->fd[1]); - rc->fd[1] = -1; - set_close_on_exec(rc->fd[0]); + close(rev_hdl->fd[1]); + rev_hdl->fd[1] = -1; + set_close_on_exec(rev_hdl->fd[0]); - /* This is an active revokechild child process */ - DLIST_ADD_END(ctdb_db->revokechild_active, rc); + rev_hdl->fde = tevent_add_fd(ctdb->ev, + rev_hdl, + rev_hdl->fd[0], + TEVENT_FD_READ, + revokechild_handler, + (void *)rev_hdl); - rc->fde = tevent_add_fd(ctdb->ev, rc, rc->fd[0], TEVENT_FD_READ, - revokechild_handler, (void *)rc); - if (rc->fde == NULL) { - DEBUG(DEBUG_ERR,("Failed to set up fd event for revokechild process\n")); - talloc_free(rc); + if (rev_hdl->fde == NULL) { + D_ERR("Failed to set up fd event for revokechild process\n"); + talloc_free(rev_hdl); } - tevent_fd_set_auto_close(rc->fde); + tevent_fd_set_auto_close(rev_hdl->fde); + + /* This is an active revokechild child process */ + DLIST_ADD_END(ctdb_db->revokechild_active, rev_hdl); + talloc_set_destructor(rev_hdl, revokechild_destructor); return 0; +err_out: + talloc_free(rev_hdl); + return -1; } int ctdb_add_revoke_deferred_call(struct ctdb_context *ctdb, struct ctdb_db_context *ctdb_db, TDB_DATA key, struct ctdb_req_header *hdr, deferred_requeue_fn fn, void *call_context) { - struct revokechild_handle *rc; + struct revokechild_handle *rev_hdl; struct revokechild_deferred_call *deferred_call; - for (rc = ctdb_db->revokechild_active; rc; rc = rc->next) { - if (rc->key.dsize == 0) { + for (rev_hdl = ctdb_db->revokechild_active; + rev_hdl; + rev_hdl = rev_hdl->next) { + if (rev_hdl->key.dsize == 0) { continue; } - if (rc->key.dsize != key.dsize) { + if (rev_hdl->key.dsize != key.dsize) { continue; } - if (!memcmp(rc->key.dptr, key.dptr, key.dsize)) { + if (!memcmp(rev_hdl->key.dptr, key.dptr, key.dsize)) { break; } } - if (rc == NULL) { + if (rev_hdl == NULL) { DEBUG(DEBUG_ERR,("Failed to add deferred call to revoke list. revoke structure not found\n")); return -1; } @@ -1936,11 +1969,11 @@ int ctdb_add_revoke_deferred_call(struct ctdb_context *ctdb, struct ctdb_db_cont deferred_call->hdr = talloc_steal(deferred_call, hdr); deferred_call->fn = fn; deferred_call->ctx = call_context; - deferred_call->rc = rc; + deferred_call->rev_hdl = rev_hdl; talloc_set_destructor(deferred_call, deferred_call_destructor); - DLIST_ADD(rc->deferred_call_list, deferred_call); + DLIST_ADD(rev_hdl->deferred_call_list, deferred_call); return 0; } diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c index 7665e2a..6d2f70f 100644 --- a/ctdb/server/ctdb_daemon.c +++ b/ctdb/server/ctdb_daemon.c @@ -903,12 +903,12 @@ static void ctdb_daemon_read_cb(uint8_t *data, size_t cnt, void *args) if (hdr->ctdb_magic != CTDB_MAGIC) { ctdb_set_error(client->ctdb, "Non CTDB packet rejected\n"); - return; + goto err_out; } if (hdr->ctdb_version != CTDB_PROTOCOL) { ctdb_set_error(client->ctdb, "Bad CTDB version 0x%x rejected in daemon\n", hdr->ctdb_version); - return; + goto err_out; } DEBUG(DEBUG_DEBUG,(__location__ " client request %u of type %u length %u from " @@ -917,6 +917,10 @@ static void ctdb_daemon_read_cb(uint8_t *data, size_t cnt, void *args) /* it is the responsibility of the incoming packet function to free 'data' */ daemon_incoming_packet(client, hdr); + return; + +err_out: + TALLOC_FREE(data); } diff --git a/ctdb/tcp/tcp_connect.c b/ctdb/tcp/tcp_connect.c index 17aafc4..13452a5 100644 --- a/ctdb/tcp/tcp_connect.c +++ b/ctdb/tcp/tcp_connect.c @@ -75,6 +75,7 @@ void ctdb_tcp_tnode_cb(uint8_t *data, size_t cnt, void *private_data) tnode->connect_te = tevent_add_timer(node->ctdb->ev, tnode, timeval_current_ofs(3, 0), ctdb_tcp_node_connect, node); + TALLOC_FREE(data); } /* diff --git a/ctdb/tcp/tcp_io.c b/ctdb/tcp/tcp_io.c index 5bb4b5b..3c3b1c1 100644 --- a/ctdb/tcp/tcp_io.c +++ b/ctdb/tcp/tcp_io.c @@ -80,7 +80,8 @@ void ctdb_tcp_read_cb(uint8_t *data, size_t cnt, void *args) return; failed: - talloc_free(in); + TALLOC_FREE(in); + TALLOC_FREE(data); } /* -- Samba Shared Repository