]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix python dict reference and double free in config.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 18 Jun 2019 15:25:08 +0000 (17:25 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 18 Jun 2019 15:25:08 +0000 (17:25 +0200)
doc/Changelog
pythonmod/pythonmod.c
util/config_file.c

index 56ceaf3c338386b59a135984c3e3482ea1d3c473..2cb6d0124ecd87a0b4897efd69c52a8efe3bbd85 100644 (file)
@@ -12,6 +12,7 @@
        - Merge PR #5: Python module: define constant MODULE_RESTART_NEXT
        - Merge PR #4: Python module: assign something useful to the
          per-query data store 'qdata' 
+       - Fix python dict reference and double free in config.
 
 17 June 2019: Wouter
        - Master contains version 1.9.3 in development.
index e87ced13c8d9af0936e774ba37981d06fe62f8ac..9006429efff5290529d5dc155a088aed01bdb192 100644 (file)
@@ -348,6 +348,7 @@ int pythonmod_init(struct module_env* env, int id)
    pe->module = PyImport_AddModule("__main__");
    pe->dict = PyModule_GetDict(pe->module);
    pe->data = PyDict_New();
+   Py_XINCREF(pe->data);
    PyModule_AddObject(pe->module, "mod_env", pe->data);
 
    /* TODO: deallocation of pe->... if an error occurs */
index 3a3ebcae33e94c3f721e3c9f7bf23999d5187704..119b222384430ca694289b04ca08dc2af129c62f 100644 (file)
@@ -1398,7 +1398,6 @@ config_delete(struct config_file* cfg)
        free(cfg->version);
        free(cfg->module_conf);
        free(cfg->outgoing_avail_ports);
-       free(cfg->python_script);
        config_delstrlist(cfg->caps_whitelist);
        config_delstrlist(cfg->private_address);
        config_delstrlist(cfg->private_domain);