From 07b7d84f0601c7047341c33493fcc9695e5e703b Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 5 Dec 2006 03:52:58 +0000 Subject: r20033: Never commit before testing Never commit before testing Never commit before testing :-) (This used to be commit fdd6ce6b7e288137aeaf62f9869441c73bedbd45) --- source4/lib/ldb/common/ldb.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c index 733f0bc29a..b52cc8e301 100644 --- a/source4/lib/ldb/common/ldb.c +++ b/source4/lib/ldb/common/ldb.c @@ -803,11 +803,12 @@ int ldb_search_exp_fmt(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct ldb_ struct ldb_dn *base, enum ldb_scope scope, const char * const *attrs, const char *exp_fmt, ...) { - struct ldb_result **res; + struct ldb_result *res; char *expression; va_list ap; int ret; + res = NULL; *result = NULL; va_start(ap, exp_fmt); @@ -818,11 +819,13 @@ int ldb_search_exp_fmt(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct ldb_ return LDB_ERR_OPERATIONS_ERROR; } - ret = ldb_search(ldb, base, scope, expression, attrs, res); + ret = ldb_search(ldb, base, scope, expression, attrs, &res); if (ret == LDB_SUCCESS) { talloc_steal(mem_ctx, res); - result = res; + *result = res; + } else { + talloc_free(res); } talloc_free(expression); -- cgit