mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
dtinfo/dtinfogen: Fix segfault introduced by over zealously fixing coverity resource leak
This commit is contained in:
parent
bc28c20524
commit
494fd64314
1 changed files with 4 additions and 2 deletions
|
@ -128,7 +128,7 @@ char *
|
||||||
SearchPath::get_real_path( const char *file_name )
|
SearchPath::get_real_path( const char *file_name )
|
||||||
{
|
{
|
||||||
CC_TPtrSlistIterator<CC_String> path_it( *search_path_table );
|
CC_TPtrSlistIterator<CC_String> path_it( *search_path_table );
|
||||||
FILE *fp;
|
FILE *fp = NULL;
|
||||||
|
|
||||||
if (file_name == NULL || *file_name == '\0')
|
if (file_name == NULL || *file_name == '\0')
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -149,8 +149,10 @@ SearchPath::get_real_path( const char *file_name )
|
||||||
fclose( fp );
|
fclose( fp );
|
||||||
return ( full_path_name );
|
return ( full_path_name );
|
||||||
}
|
}
|
||||||
|
if(fp) {
|
||||||
fclose( fp );
|
fclose( fp );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue