1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-12 20:58:37 +03:00

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 <swen@linux.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Swen Schillig 2020-03-30 12:29:38 +02:00 committed by Martin Schwenke
parent 6e146c855a
commit 95fc8bd44a

View File

@ -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;