s4-ldb: fixed valgrind error: ares can be freed by callback
authorAndrew Tridgell <tridge@samba.org>
Wed, 30 Dec 2009 10:36:31 +0000 (21:36 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 1 Jan 2010 21:16:56 +0000 (08:16 +1100)
source4/lib/ldb/common/ldb_modules.c

index 5e9d0e6e988adc5a55e5f1028100c11afda346aa..3b8934702aef017aa36852bf15f67a3110cb737a 100644 (file)
@@ -829,10 +829,7 @@ int ldb_module_done(struct ldb_request *req,
                ldb_debug_end(req->handle->ldb, LDB_DEBUG_TRACE);
        }
 
-       req->callback(req, ares);
-       /* returning ares->error here allows the callback routines in
-          modules to override the error code */
-       return ares->error;
+       return req->callback(req, ares);
 }
 
 /* to be used *only* in modules init functions.