From 32b1f78b23b0f47d38417f75af1341a0662184f1 Mon Sep 17 00:00:00 2001 From: Petr Cech Date: Mon, 21 Mar 2016 09:15:17 -0400 Subject: [PATCH] LDB: Redudant test on NULL context remove There is redudant test on NULL context in ldb_dn_new_fmt() function. We use this (NULL) context in talloc_vasprintf() function which is able to work with NULL at all. And at the end, we free this newly created (by talloc_vasprintf) context. So it should be safe to remove this check. Signed-off-by: Petr Cech Reviewed-by: Simo Sorce Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Tue Apr 26 08:09:25 CEST 2016 on sn-devel-144 --- lib/ldb/common/ldb_dn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ldb/common/ldb_dn.c b/lib/ldb/common/ldb_dn.c index b7d2de7e00f..ab78776368e 100644 --- a/lib/ldb/common/ldb_dn.c +++ b/lib/ldb/common/ldb_dn.c @@ -171,7 +171,7 @@ struct ldb_dn *ldb_dn_new_fmt(TALLOC_CTX *mem_ctx, char *strdn; va_list ap; - if ( (! mem_ctx) || (! ldb)) return NULL; + if (! ldb) return NULL; va_start(ap, new_fmt); strdn = talloc_vasprintf(mem_ctx, new_fmt, ap); -- 2.47.3