diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-03-09 17:19:01 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-03-09 17:59:12 +0100 |
commit | 5f606b0a5bcf71e7584403c9582188f1f564c67c (patch) | |
tree | 87c7200897696c4ee1f0d340f1060d65bdc085b6 /rsc | |
parent | 7657115dd98b0583852476d75e8676d1ff631014 (diff) |
coverity#705676: fix memory leak
Change-Id: Ibae1a0d073249ecfbfee0f73473d66bbf2602aff
Diffstat (limited to 'rsc')
-rw-r--r-- | rsc/source/parser/rscyacc.y | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/rsc/source/parser/rscyacc.y b/rsc/source/parser/rscyacc.y index 4fbf0fd6f328..d0be59ede316 100644 --- a/rsc/source/parser/rscyacc.y +++ b/rsc/source/parser/rscyacc.y @@ -178,14 +178,17 @@ sal_Bool DoClassHeader( RSCHEADER * pHeader, sal_Bool bMember ) else S.Push( pHeader->pClass->Create( NULL, RSCINST() ) ); - ObjNode * pNode = new ObjNode( aName1, S.Top().pData, - pFI->GetFileIndex() ); pTC->pEH->StdOut( ".", RscVerbosityVerbose ); if( !aName1.IsId() ) pTC->pEH->Error( ERR_IDEXPECTED, pHeader->pClass, aName1 ); - else if( !pHeader->pClass->PutObjNode( pNode ) ) - pTC->pEH->Error( ERR_DOUBLEID, pHeader->pClass, aName1 ); + else + { + ObjNode * pNode = new ObjNode( aName1, S.Top().pData, + pFI->GetFileIndex() ); + if( !pHeader->pClass->PutObjNode( pNode ) ) + pTC->pEH->Error( ERR_DOUBLEID, pHeader->pClass, aName1 ); + } } else { |