From: Petr Cech Date: Mon, 21 Mar 2016 13:15:17 +0000 (-0400) Subject: LDB: Redudant test on NULL context remove X-Git-Tag: talloc-2.1.7~128 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=32b1f78b23b0f47d38417f75af1341a0662184f1;p=thirdparty%2Fsamba.git 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 --- 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);