summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-12-05 03:52:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:28:51 -0500
commitfdd6ce6b7e288137aeaf62f9869441c73bedbd45 (patch)
tree39a02daefaea12825f112ba5b3b09d831112b9c5 /source
parent2a2e181e4bc382d69056cebace9a4ae9897bdfbc (diff)
downloadsamba-fdd6ce6b7e288137aeaf62f9869441c73bedbd45.tar.gz
r20033: Never commit before testing
Never commit before testing Never commit before testing :-)
Diffstat (limited to 'source')
-rw-r--r--source/lib/ldb/common/ldb.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/lib/ldb/common/ldb.c b/source/lib/ldb/common/ldb.c
index 733f0bc29a4..b52cc8e3017 100644
--- a/source/lib/ldb/common/ldb.c
+++ b/source/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);