From: Swen Schillig Date: Mon, 30 Mar 2020 10:29:38 +0000 (+0200) Subject: ctdbd_conn: possible memleak in ctdbd_dbpath X-Git-Tag: ldb-2.2.0~1130 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95fc8bd44a2ba942a6052fe8abaf6a4dceca8b3d;p=thirdparty%2Fsamba.git ctdbd_conn: possible memleak in ctdbd_dbpath A cstatus != 0 does not guarantee to have no received data referenced by rdata.dptr. Therefore, make sure rdata.dptr is free'd. Signed-off-by: Swen Schillig Reviewed-by: Volker Lendecke Reviewed-by: Martin Schwenke --- diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index ec9b3a07812..33c811a06b7 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -834,7 +834,7 @@ char *ctdbd_dbpath(struct ctdbd_connection *conn, if ((ret != 0) || cstatus != 0) { DEBUG(0, (__location__ " ctdb_control for getdbpath failed: %s\n", strerror(ret))); - return NULL; + TALLOC_FREE(rdata.dptr); } return (char *)rdata.dptr;