From: W.C.A. Wijngaards Date: Tue, 18 Jun 2019 15:25:08 +0000 (+0200) Subject: - Fix python dict reference and double free in config. X-Git-Tag: release-1.9.3rc1~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78b2f1cc2046a163a176863aea89b3851741e357;p=thirdparty%2Funbound.git - Fix python dict reference and double free in config. --- diff --git a/doc/Changelog b/doc/Changelog index 56ceaf3c3..2cb6d0124 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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. diff --git a/pythonmod/pythonmod.c b/pythonmod/pythonmod.c index e87ced13c..9006429ef 100644 --- a/pythonmod/pythonmod.c +++ b/pythonmod/pythonmod.c @@ -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 */ diff --git a/util/config_file.c b/util/config_file.c index 3a3ebcae3..119b22238 100644 --- a/util/config_file.c +++ b/util/config_file.c @@ -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);