ofz: Direct-leak
Change-Id: I40024334b394e4de6a1766321556689234da86ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131840 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
parent
f433d9cf8b
commit
d643f9d5c6
3 changed files with 11 additions and 5 deletions
|
@ -1175,12 +1175,13 @@ yyerrhandle:
|
|||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Node *mainParse(const char *_code)
|
||||
{
|
||||
initFlex( _code );
|
||||
top = nullptr;
|
||||
yyparse();
|
||||
deinitFlex();
|
||||
|
||||
if( top )
|
||||
return top;
|
||||
else
|
||||
|
|
|
@ -2107,6 +2107,13 @@ void initFlex(const char *_code )
|
|||
yy_switch_to_buffer( yy_scan_string(_code) );
|
||||
}
|
||||
|
||||
void deinitFlex()
|
||||
{
|
||||
// flex faq-memory-leak
|
||||
yy_delete_buffer(YY_CURRENT_BUFFER);
|
||||
yy_init = 1;
|
||||
}
|
||||
|
||||
int yywrap()
|
||||
{
|
||||
yy_delete_buffer( YY_CURRENT_BUFFER );
|
||||
|
|
|
@ -17,13 +17,11 @@
|
|||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_HWPFILTER_SOURCE_LEXER_HXX
|
||||
#define INCLUDED_HWPFILTER_SOURCE_LEXER_HXX
|
||||
#pragma once
|
||||
|
||||
void initFlex(char const* s);
|
||||
void deinitFlex();
|
||||
|
||||
int yylex();
|
||||
|
||||
#endif
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
|
Loading…
Reference in a new issue