diff options
author | Simo Sorce <idra@samba.org> | 2009-05-21 21:32:17 -0400 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2009-06-02 12:41:56 +0200 |
commit | a89c969d86ccf6eb74c413dfaa608a99200a86ff (patch) | |
tree | ff92b4ba0865119998cba4a992d04923b8131ce3 | |
parent | 7140792b54de7f692cfd10c0563d48c5c6d6d727 (diff) | |
download | samba-a89c969d86ccf6eb74c413dfaa608a99200a86ff.tar.gz |
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).
(cherry picked from commit c60539f31f63bd65e5b0e3ee16365f036bef3d5b)
-rw-r--r-- | 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 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; |