]> jfr.im git - irc/atheme/atheme.git/commitdiff
libathemecore/conf.c: fix minor memory leak with hide_xop
authorNicole Kleinhoff <redacted>
Fri, 19 Feb 2021 07:43:40 +0000 (07:43 +0000)
committerNicole Kleinhoff <redacted>
Fri, 19 Feb 2021 07:47:27 +0000 (07:47 +0000)
The entries in global_template_dict are heap-allocated structures;
hide_xop was deleting the entries without freeing them, leaking a few
bytes each time the config was loaded.

(cherry picked from commit f22b8f34a5174e87d3cc2a008ca3317fe33ac61e)

libathemecore/conf.c

index f1ada3ef844796de3727a9a4282d6531f12b8317..53777212a6a432a30ed2acd0594c5ab1d4394570 100644 (file)
@@ -948,10 +948,10 @@ bool conf_check(void)
 
        if (chansvs.hide_xop)
        {
-               mowgli_patricia_delete(global_template_dict,"VOP");
-               mowgli_patricia_delete(global_template_dict,"HOP");
-               mowgli_patricia_delete(global_template_dict,"AOP");
-               mowgli_patricia_delete(global_template_dict,"SOP");
+               sfree(mowgli_patricia_delete(global_template_dict,"VOP"));
+               sfree(mowgli_patricia_delete(global_template_dict,"HOP"));
+               sfree(mowgli_patricia_delete(global_template_dict,"AOP"));
+               sfree(mowgli_patricia_delete(global_template_dict,"SOP"));
        }
        else
        {