From: Sebastian Harl Date: Fri, 25 Apr 2014 22:14:37 +0000 (+0200) Subject: frontend: Added destructors for dynamically allocated objects in the parser. X-Git-Tag: sysdb-0.1.0~82 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=22ab0383bb3117c4ebe6addb0cdb18929fed1c0f;p=sysdb.git frontend: Added destructors for dynamically allocated objects in the parser. This will make sure that the memory is freed in case of parse errors. --- diff --git a/src/frontend/grammar.y b/src/frontend/grammar.y index 26c8c1b..abab594 100644 --- a/src/frontend/grammar.y +++ b/src/frontend/grammar.y @@ -104,6 +104,9 @@ sdb_fe_yyerror(YYLTYPE *lval, sdb_fe_yyscan_t scanner, const char *msg); %type matcher compare_matcher +%destructor { free($$); } +%destructor { sdb_object_deref(SDB_OBJ($$)); } + %% statements: