From: Gary Lockyer Date: Tue, 14 Jan 2020 01:42:26 +0000 (+1300) Subject: lib ldb common: Fix memory leak X-Git-Tag: ldb-2.1.0^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79460b1b9f3452d6d68014b84f4a9dc3988bd916;p=thirdparty%2Fsamba.git lib ldb common: Fix memory leak TALLOC_FREE the ldb_control allocated in ldb_parse_control_from_string when none of the cases match. Credit to OSS-Fuzz Signed-off-by: Gary Lockyer Reviewed-by: David Disseldorp --- diff --git a/lib/ldb/common/ldb_controls.c b/lib/ldb/common/ldb_controls.c index 8a727f74e6e..4af06a436ab 100644 --- a/lib/ldb/common/ldb_controls.c +++ b/lib/ldb/common/ldb_controls.c @@ -1282,6 +1282,7 @@ struct ldb_control *ldb_parse_control_from_string(struct ldb_context *ldb, TALLO /* * When no matching control has been found. */ + TALLOC_FREE(ctrl); return NULL; }