diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2012-07-14 01:05:03 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2012-07-14 01:05:03 +0200 |
commit | c48c7560eed91616a33771deae9b4a4d1ccd77e8 (patch) | |
tree | 2183ccf12b62665c508cd4a30a01d5c4270cab1b /sal | |
parent | 962d78294bec0df5e5120ac8fd10355a6e0e6988 (diff) |
Let's check struct var != NULL before initializing its attributes
Change-Id: I968292c1c64bcd3dd3d21dfd991c1a31edec8893
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/profile.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sal/osl/unx/profile.c b/sal/osl/unx/profile.c index cfdb5ea9bcce..773630592d3e 100644 --- a/sal/osl/unx/profile.c +++ b/sal/osl/unx/profile.c @@ -1876,19 +1876,20 @@ static sal_Bool loadProfile(osl_TFile* pFile, osl_TProfileImpl* pProfile) sal_Char* pLine; sal_Char* bWasAdded = NULL; - pProfile->m_NoLines = 0; - pProfile->m_NoSections = 0; - if ( pFile == 0 ) + if ( !pFile ) { return sal_False; } - if ( pProfile == 0 ) + if ( !pProfile ) { return sal_False; } + pProfile->m_NoLines = 0; + pProfile->m_NoSections = 0; + OSL_VERIFY(OslProfile_rewindFile(pFile, sal_False)); while ( ( pLine=OslProfile_getLine(pFile) ) != 0 ) |