]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r19297: fixed a leak in the ejs ldb interface
authorAndrew Tridgell <tridge@samba.org>
Sun, 15 Oct 2006 21:40:49 +0000 (21:40 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:21:04 +0000 (14:21 -0500)
(This used to be commit 6978225ffcc12ffdda0d3404e855219808c0597c)

source4/scripting/ejs/smbcalls_ldb.c

index d5735dce70bbcaf07a9f100c0d91756eafebf18f..f8296b9d36026bc42de64da2f5738284b8d7bed8 100644 (file)
@@ -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;