dtinfo/dtinfogen: Fix segfault introduced by over zealously fixing coverity resource leak
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user