coverity#983099: fix memory leak

Change-Id: I2fe582bc9b082ab4cac7cc7e6c521087f4906436
This commit is contained in:
Markus Mohrhard 2013-03-02 11:29:44 +01:00
parent ddf1b13a52
commit c04fde0063

View file

@ -332,7 +332,9 @@ oslFileError SAL_CALL osl_getFileURLFromSystemPath( rtl_uString *ustrSystemPath,
if( ( 1 == ustrSystemPath->length ) || ( (sal_Unicode)'/' == ustrSystemPath->buffer[1] ) )
{
/* osl_getHomeDir returns file URL */
osl_getHomeDir( osl_getCurrentSecurity(), &pTmp );
oslSecurity pSecurity = osl_getCurrentSecurity();
osl_getHomeDir( pSecurity , &pTmp );
osl_freeSecurityHandle( pSecurity );
/* remove "file://" prefix */
rtl_uString_newFromStr_WithLength( &pTmp, pTmp->buffer + 7, pTmp->length - 7 );