]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
fix a possible free after use
authorAndrew Tridgell <tridge@samba.org>
Tue, 10 Apr 2007 03:05:23 +0000 (13:05 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 10 Apr 2007 03:05:23 +0000 (13:05 +1000)
(This used to be ctdb commit 55bc7ee10b9e9df32792b6b5779f094eb513069e)

ctdb/common/ctdb_call.c

index 77ec87285241e5f225d6d1db0b17ff68eec8b337..4c9916d62b9519fa60a88c263531560a5c4c29c8 100644 (file)
@@ -418,6 +418,10 @@ void ctdb_reply_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
 
        talloc_steal(state, c);
 
+       /* get an extra reference here - this prevents the free in ctdb_recv_pkt()
+          from freeing the data */
+       (void)talloc_reference(state, c);
+
        state->state = CTDB_CALL_DONE;
 }