From: W.C.A. Wijngaards Date: Tue, 18 Jun 2019 15:07:57 +0000 (+0200) Subject: Merge branch 'dev/all-merged/master' of git://github.com/episource/unbound into episo... X-Git-Tag: release-1.9.3rc1~29^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=63b2628a1857b4ae2a3586333e15589ad31ace54;p=thirdparty%2Funbound.git Merge branch 'dev/all-merged/master' of git://github.com/episource/unbound into episource-dev/all-merged/master --- 63b2628a1857b4ae2a3586333e15589ad31ace54 diff --cc pythonmod/pythonmod.c index 9009a28da,b19c97c55..e87ced13c --- a/pythonmod/pythonmod.c +++ b/pythonmod/pythonmod.c @@@ -246,10 -255,9 +255,11 @@@ int pythonmod_init(struct module_env* e FILE* script_py = NULL; PyObject* py_init_arg, *res; PyGILState_STATE gil; - int init_standard = 1; + int init_standard = 1, i = 0; - +#if PY_MAJOR_VERSION < 3 + PyObject* PyFileObject = NULL; +#endif + struct config_strlist* cfg_item = env->cfg->python_script; struct pythonmod_env* pe = (struct pythonmod_env*)calloc(1, sizeof(struct pythonmod_env)); if (!pe) @@@ -352,13 -360,10 +370,14 @@@ (void)PyParser_SimpleParseFile(script_py, pe->fname, Py_file_input); log_py_err(); PyGILState_Release(gil); + fclose(script_py); return 0; } +#if PY_MAJOR_VERSION < 3 + Py_XDECREF(PyFileObject); +#else fclose(script_py); +#endif if ((pe->func_init = PyDict_GetItemString(pe->dict, "init_standard")) == NULL) { diff --cc util/configparser.c index 1dc53f7b2,2b5ed3f68..f85f3b3b4 --- a/util/configparser.c +++ b/util/configparser.c @@@ -5745,21 -5709,21 +5745,21 @@@ yyreduce { OUTYY(("\nP(python:)\n")); } -#line 5713 "util/configparser.c" /* yacc.c:1648 */ +#line 5749 "util/configparser.c" /* yacc.c:1648 */ break; - case 508: -#line 2721 "./util/configparser.y" /* yacc.c:1648 */ + case 509: +#line 2739 "./util/configparser.y" /* yacc.c:1648 */ { OUTYY(("P(python-script:%s)\n", (yyvsp[0].str))); - free(cfg_parser->cfg->python_script); - cfg_parser->cfg->python_script = (yyvsp[0].str); + if(!cfg_strlist_append_ex(&cfg_parser->cfg->python_script, (yyvsp[0].str))) + yyerror("out of memory"); } -#line 5723 "util/configparser.c" /* yacc.c:1648 */ +#line 5759 "util/configparser.c" /* yacc.c:1648 */ break; - case 509: -#line 2727 "./util/configparser.y" /* yacc.c:1648 */ + case 510: +#line 2745 "./util/configparser.y" /* yacc.c:1648 */ { OUTYY(("P(disable_dnssec_lame_check:%s)\n", (yyvsp[0].str))); if (strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)