diff options
author | Amitay Isaacs <amitay@gmail.com> | 2013-07-23 16:00:15 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@gmail.com> | 2013-08-22 16:59:49 +1000 |
commit | 19444f7c3d4bec60cbade5e3f2dfc4aafeed0328 (patch) | |
tree | 8ed664d0cef151eb30e60b219f365a183041e63a /ctdb/server/ctdb_call.c | |
parent | a61a4b1254e162f39ac22665868ec116a96815f3 (diff) | |
download | samba-19444f7c3d4bec60cbade5e3f2dfc4aafeed0328.tar.gz samba-19444f7c3d4bec60cbade5e3f2dfc4aafeed0328.tar.xz samba-19444f7c3d4bec60cbade5e3f2dfc4aafeed0328.zip |
ctdbd: Make sure call data is freed if doing an early return
This should avoid memory bloat when a request bounces between nodes.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 7677fb263f06a97398e2c546e32273fb96edca69)
Diffstat (limited to 'ctdb/server/ctdb_call.c')
-rw-r--r-- | ctdb/server/ctdb_call.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ctdb/server/ctdb_call.c b/ctdb/server/ctdb_call.c index 017e4f575ce..e35f044b44c 100644 --- a/ctdb/server/ctdb_call.c +++ b/ctdb/server/ctdb_call.c @@ -761,7 +761,9 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr) */ if (ctdb_db->sticky) { if (ctdb_defer_pinned_down_request(ctdb, ctdb_db, call->key, hdr) == 0) { - DEBUG(DEBUG_WARNING,("Defer request for pinned down record in %s\n", ctdb_db->db_name)); + DEBUG(DEBUG_WARNING, + ("Defer request for pinned down record in %s\n", ctdb_db->db_name)); + talloc_free(call); return; } } @@ -775,10 +777,12 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr) ctdb_call_input_pkt, ctdb, false); if (ret == -1) { ctdb_send_error(ctdb, hdr, ret, "ltdb fetch failed in ctdb_request_call"); + talloc_free(call); return; } if (ret == -2) { DEBUG(DEBUG_INFO,(__location__ " deferred ctdb_request_call\n")); + talloc_free(call); return; } @@ -828,6 +832,7 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr) if (ret != 0) { DEBUG(DEBUG_ERR,(__location__ " ctdb_ltdb_unlock() failed with error %d\n", ret)); } + talloc_free(call); return; } @@ -904,6 +909,7 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr) CTDB_INCREMENT_DB_STAT(ctdb_db, db_ro_delegations); talloc_free(r); + talloc_free(call); return; } @@ -949,8 +955,9 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr) if (ret != 0) { DEBUG(DEBUG_ERR,(__location__ " ctdb_ltdb_unlock() failed with error %d\n", ret)); } - return; } + talloc_free(call); + return; } ret = ctdb_call_local(ctdb_db, call, &header, hdr, &data, true); @@ -979,6 +986,7 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr) ctdb_queue_packet(ctdb, &r->hdr); talloc_free(r); + talloc_free(call); } /** |