in ctdb_call_local() we can not talloc_steal() the returned data and hang it off...
authorRonnie Sahlberg <sahlberg@samba.org>
Wed, 19 Mar 2008 02:54:17 +0000 (13:54 +1100)
committerRonnie Sahlberg <sahlberg@samba.org>
Wed, 19 Mar 2008 02:54:17 +0000 (13:54 +1100)
commit4becf32aea088a25686e8bc330eb47d85ae0ef8f
tree94f9fe080035b0f2bc0f033159854fde0c3223bf
parent53c4f483bb122e6fa13abcc6d4584130f20af461
in ctdb_call_local() we can not talloc_steal() the returned data and hang it off ctdb.
This can cause a memory leak if the call is terminated before we have managed to respond to the client.
(and the call is talloc_free()d but the data is still hanging off ctdb)

instead we must talloc_steal() the data and hang it off the call structure to avoid the memory leak.

In order to do this we must also change the call structure that is passed into ctdb_call_local() to be allocated through talloc().

This structure was previously either a static variable, or an element of a larger talloc()ed structure (ctdb_call_state or ctdb_client_call_state) so
we must change all creations of a ctdb_call into explicitely creating it through talloc()
client/ctdb_client.c
include/ctdb_private.h
server/ctdb_call.c