From f9e89659e9c8d3c6cc5661a43e755f3d2062cc82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Czerpak?= Date: Thu, 28 Sep 2017 15:11:11 +0200 Subject: [PATCH] 2017-09-28 15:11 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/pp/ppcore.c ! fixed memory leak in unclosed extended block --- ChangeLog.txt | 4 ++++ src/pp/ppcore.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index a5bf247810..57bfeeb290 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,6 +7,10 @@ Entries may not always be in chronological/commit order. See license at the end of file. */ +2017-09-28 15:11 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * src/pp/ppcore.c + ! fixed memory leak in unclosed extended block + 2017-09-28 14:55 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/pp/ppcore.c ! fixed line numbering in unclosed extended block diff --git a/src/pp/ppcore.c b/src/pp/ppcore.c index 65604ff3f5..08ac9d55de 100644 --- a/src/pp/ppcore.c +++ b/src/pp/ppcore.c @@ -1494,7 +1494,7 @@ static void hb_pp_getLine( PHB_PP_STATE pState ) if( pEolTokenPtr && ( pEolTokenPtr != pState->pNextTokenPtr || - ( pState->iNestedBlock && + ( pState->iNestedBlock && pState->pFile->iTokens && ( pState->pFile->pLineBuf ? pState->pFile->nLineBufLen == 0 : pState->pFile->fEof ) ) ) ) { @@ -1507,6 +1507,8 @@ static void hb_pp_getLine( PHB_PP_STATE pState ) iStartLine++; iLines++; } + if( pToken == NULL ) + pState->pNextTokenPtr = pEolTokenPtr; *pEolTokenPtr = pToken; }