From: Swen Schillig Date: Tue, 13 Mar 2018 08:34:52 +0000 (+0100) Subject: ctdb: Fixing possible memory leak in ctdb_tcp_read_cb X-Git-Tag: talloc-2.1.13~105 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aba3d508028567ccbfe8ea986d8f2b3f48af6215;p=thirdparty%2Fsamba.git 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 Reviewed-by: Martin Schwenke Reviewed-by: Jeremy Allison --- diff --git a/ctdb/tcp/tcp_io.c b/ctdb/tcp/tcp_io.c index 5bb4b5bd1a7..3c3b1c167f3 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); } /*