]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Avoid a tdb handle leak
authorVolker Lendecke <vl@samba.org>
Sat, 23 Sep 2023 07:50:41 +0000 (00:50 -0700)
committerJeremy Allison <jra@samba.org>
Mon, 25 Sep 2023 19:01:34 +0000 (19:01 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/param/util.c

index fce1de195395b4dfb3d44493e5b3f29508b4d91b..8d862ad67689d5d0679ff47dd70b5c37dbc7918a 100644 (file)
@@ -332,4 +332,9 @@ void lpcfg_default_kdc_policy(TALLOC_CTX *mem_ctx,
        if (!ctx || ( val = tdb_fetch_lifetime(ctx, "kdc:renewal_lifetime") ) == -1 )
                val = lpcfg_parm_long(lp_ctx, NULL, "kdc", "renewal lifetime", 24 * 7);
        *renewal_lifetime = val * 60 * 60;
+
+       if (ctx != NULL) {
+               tdb_close(ctx);
+               ctx = NULL;
+       }
 }