From: Andrew Tridgell Date: Sun, 15 Oct 2006 21:40:49 +0000 (+0000) Subject: r19297: fixed a leak in the ejs ldb interface X-Git-Tag: samba-4.0.0alpha6~801^3~4496 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d08f8ab4336583150ca072250bd71076a5c1e366;p=thirdparty%2Fsamba.git r19297: fixed a leak in the ejs ldb interface (This used to be commit 6978225ffcc12ffdda0d3404e855219808c0597c) --- diff --git a/source4/scripting/ejs/smbcalls_ldb.c b/source4/scripting/ejs/smbcalls_ldb.c index d5735dce70b..f8296b9d360 100644 --- a/source4/scripting/ejs/smbcalls_ldb.c +++ b/source4/scripting/ejs/smbcalls_ldb.c @@ -60,7 +60,7 @@ static int ejs_ldbSearch(MprVarHandle eid, int argc, struct MprVar **argv) TALLOC_CTX *tmp_ctx = talloc_new(mprMemCtx()); struct ldb_context *ldb; int ret; - struct ldb_result *res; + struct ldb_result *res=NULL; /* validate arguments */ if (argc < 1 || argc > 4) { @@ -112,7 +112,7 @@ static int ejs_ldbSearch(MprVarHandle eid, int argc, struct MprVar **argv) } else { mpr_Return(eid, mprLdbArray(ldb, res->msgs, res->count, "ldb_message")); } - + talloc_free(res); talloc_free(tmp_ctx); return 0;