From c60539f31f63bd65e5b0e3ee16365f036bef3d5b 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 file changed, 1 insertion(+) diff --git a/source/lib/ldb/common/ldb.c b/source/lib/ldb/common/ldb.c index 743711b9672..c8aa6afdfc1 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; -- 2.11.4.GIT