From: Andreas Schneider Date: Wed, 22 Jun 2016 13:48:10 +0000 (+0200) Subject: s4-dsdb: Fix a possible NULL pointer dereference X-Git-Tag: tdb-1.3.10~746 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f01f4248536c6f4b2cfe6f28f775deb7cb2fe01a;p=thirdparty%2Fsamba.git s4-dsdb: Fix a possible NULL pointer dereference Detected by clang compiler. Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison --- diff --git a/source4/dsdb/common/util_trusts.c b/source4/dsdb/common/util_trusts.c index 0e69ba20b73..a083d869f6e 100644 --- a/source4/dsdb/common/util_trusts.c +++ b/source4/dsdb/common/util_trusts.c @@ -2671,7 +2671,9 @@ NTSTATUS dsdb_trust_get_incoming_passwords(struct ldb_message *msg, if (_previous != NULL) { *_previous = talloc(mem_ctx, struct samr_Password); if (*_previous == NULL) { - TALLOC_FREE(*_current); + if (_current != NULL) { + TALLOC_FREE(*_current); + } TALLOC_FREE(frame); return NT_STATUS_NO_MEMORY; }