]> git.ipfire.org Git - thirdparty/samba.git/commit
dbwrap: fix possible memleak and false result check.
authorSwen Schillig <swen@linux.ibm.com>
Mon, 30 Mar 2020 10:54:00 +0000 (12:54 +0200)
committerMartin Schwenke <martins@samba.org>
Thu, 2 Apr 2020 11:26:32 +0000 (11:26 +0000)
commit130c26b43ffbb577438006e4e4acfb0e88199c64
treedcbecac17f6abd127894fd8ff5e68cc0448a4eee
parentf34582af1d61e7c6e28226e7a5e9c1de45eac56b
dbwrap: fix possible memleak and false result check.

A cstatus != 0 or a data.dsize != sizeof(uint32_t)
does not guarantee to have no received data referenced by data.dptr.
Therefore, make sure data.dptr is free'd.
Reusing the same data structure as data input and data output parameter
can lead to wrong results, especially when the output parameters value
is used to detect errors. Create the additional local variable outdata
to prevent this issue.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Apr  2 11:26:32 UTC 2020 on sn-devel-184
source3/lib/dbwrap/dbwrap_ctdb.c