]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Insure we always return NULL on error.
authorSimo Sorce <idra@samba.org>
Fri, 22 May 2009 01:32:17 +0000 (21:32 -0400)
committerKarolin Seeger <kseeger@samba.org>
Sat, 23 May 2009 19:00:46 +0000 (21:00 +0200)
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

index 743711b9672ca73a482767a855c7dc9db439d2a6..c8aa6afdfc131cc08f9f6caf9f9081a5e709a112 100644 (file)
@@ -787,6 +787,7 @@ int ldb_search(struct ldb_context *ldb,
 done:
        if (ret != LDB_SUCCESS) {
                talloc_free(res);
+               res = NULL;
        }
 
        *_res = res;