summaryrefslogtreecommitdiffstats
path: root/src/declinfo.l
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2019-05-12 12:23:55 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2019-05-12 12:23:55 (GMT)
commit723b842ca1de2f8565717d7099f8ff61b63f6026 (patch)
tree660e260b4343b37166e4a2717ebdf9338cd90c84 /src/declinfo.l
parent9a8bf5711e7bc603922a342447e27a81170b965a (diff)
downloadDoxygen-723b842ca1de2f8565717d7099f8ff61b63f6026.zip
Doxygen-723b842ca1de2f8565717d7099f8ff61b63f6026.tar.gz
Doxygen-723b842ca1de2f8565717d7099f8ff61b63f6026.tar.bz2
Fixed memory leak in reentrant lexers
Diffstat (limited to 'src/declinfo.l')
-rw-r--r--src/declinfo.l8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/declinfo.l b/src/declinfo.l
index 696d000..e7e9164 100644
--- a/src/declinfo.l
+++ b/src/declinfo.l
@@ -243,13 +243,16 @@ static struct declinfoYY_state g_declinfo_extra;
void parseFuncDecl(const QCString &decl,bool objC,QCString &cl,QCString &t,
QCString &n,QCString &a,QCString &ftl,QCString &exc)
{
+ if (decl.isEmpty())
+ {
+ return;
+ }
declinfoYYlex_init_extra(&g_declinfo_extra, &g_yyscanner);
struct yyguts_t *yyg = (struct yyguts_t*)g_yyscanner;
printlex(yy_flex_debug, TRUE, __FILE__, NULL);
yyextra->inputString = decl;
//printf("Input=`%s'\n",yyextra->inputString);
- if (yyextra->inputString==0) return;
yyextra->inputPosition = 0;
yyextra->classTempListFound = FALSE;
yyextra->funcTempListFound = FALSE;
@@ -324,9 +327,8 @@ void parseFuncDecl(const QCString &decl,bool objC,QCString &cl,QCString &t,
// t.data(),cl.data(),n.data(),a.data());
printlex(yy_flex_debug, FALSE, __FILE__, NULL);
+ declinfoYYlex_destroy(g_yyscanner);
return;
-
-
}
//extern "C" { // some bogus code to keep the compiler happy