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)
(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)
{
{
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)