From 61c3795e0fa8b5186b76f5b261393ca3f1d060ec Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Thu, 21 May 2009 21:32:17 -0400 Subject: [PATCH] Insure we always return NULL on error. It is not technically an ldb bug, but apparently some callers try to access res before checking the ldb_search() return code. So make their attempt very evident (a NULL dereference will make it cristal clear where the bug is). --- source/lib/ldb/common/ldb.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/source/lib/ldb/common/ldb.c b/source/lib/ldb/common/ldb.c index 743711b..c8aa6af 100644 --- a/source/lib/ldb/common/ldb.c +++ b/source/lib/ldb/common/ldb.c @@ -787,6 +787,7 @@ int ldb_search(struct ldb_context *ldb, done: if (ret != LDB_SUCCESS) { talloc_free(res); + res = NULL; } *_res = res; -- 1.6.0.6