From aba3d508028567ccbfe8ea986d8f2b3f48af6215 Mon Sep 17 00:00:00 2001 From: Swen Schillig Date: Tue, 13 Mar 2018 09:34:52 +0100 Subject: [PATCH] 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 --- ctdb/tcp/tcp_io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } /* -- 2.34.1