From 61e82ee1ae7c01c8c4eab46d6f81533a8fa63046 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 19 May 2016 01:32:12 -0500 Subject: [PATCH] Fix memory allocation bugs --- src/ioc/dbStatic/dbYacc.y | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ioc/dbStatic/dbYacc.y b/src/ioc/dbStatic/dbYacc.y index abcc11981..870ff01b0 100644 --- a/src/ioc/dbStatic/dbYacc.y +++ b/src/ioc/dbStatic/dbYacc.y @@ -278,7 +278,7 @@ alias: tokenALIAS '(' tokenSTRING ',' tokenSTRING ')' json_object: '{' '}' { - $$ = "{}"; + $$ = dbmfStrdup("{}"); if (dbStaticDebug>2) printf("json %s\n", $$); } | '{' json_members '}' @@ -305,7 +305,7 @@ json_pair: jsonSTRING ':' json_value json_array: '[' ']' { - $$ = "[]"; + $$ = dbmfStrdup("[]"); if (dbStaticDebug>2) printf("json %s\n", $$); } | '[' json_elements ']' @@ -323,9 +323,9 @@ json_elements: json_value if (dbStaticDebug>2) printf("json %s\n", $$); }; -json_value: jsonNULL { $$ = "null"; } - | jsonTRUE { $$ = "true"; } - | jsonFALSE { $$ = "false"; } +json_value: jsonNULL { $$ = dbmfStrdup("null"); } + | jsonTRUE { $$ = dbmfStrdup("true"); } + | jsonFALSE { $$ = dbmfStrdup("false"); } | jsonNUMBER | jsonSTRING | json_array