MXS-2917 Add missing destructors to sqlite rules
Lemon (the sqlite parser generator) destructors are needed for all rules that return dynamically allocated structures. Otherwise there may be leaks if a statement is not completely parsed.
This commit is contained in:
parent
4a2d3dc55b
commit
8dd9a4ca27
@ -1878,6 +1878,7 @@ expr(A) ::= LP(B) expr(X) RP(E). {A.pExpr = X.pExpr; spanSet(&A,&B,&E);}
|
||||
%endif
|
||||
%ifdef MAXSCALE
|
||||
%type exprs {ExprSpan}
|
||||
%destructor exprs {sqlite3ExprDelete(pParse->db, $$.pExpr);}
|
||||
exprs(A) ::= expr(X). { A = X; }
|
||||
exprs(A) ::= exprs(X) COMMA(OP) expr(Y). {spanBinaryExpr(&A,pParse,@OP,&X,&Y);}
|
||||
expr(A) ::= LP(B) exprs(X) RP(E). {A.pExpr = X.pExpr; spanSet(&A,&B,&E);}
|
||||
@ -2908,6 +2909,7 @@ cmd ::= DROP DATABASE ifexists id(X). {
|
||||
cmd ::= call.
|
||||
|
||||
%type call_args_opt {ExprList*}
|
||||
%destructor call_args_opt {sqlite3ExprListDelete(pParse->db, $$);}
|
||||
call_args_opt(A) ::= . {A=0;}
|
||||
call_args_opt(A) ::= LP exprlist(X) RP. {A=X;}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user