Skip to content

Commit

Permalink
QCommon/Files: fixed memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
tobydox committed Aug 12, 2011
1 parent d563c36 commit e72fcbd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/qcommon/files.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,11 +556,13 @@ static void FS_CopyFile( char *fromOSPath, char *toOSPath ) {
fclose( f );

if ( FS_CreatePath( toOSPath ) ) {
free( buf );
return;
}

f = fopen( toOSPath, "wb" );
if ( !f ) {
free( buf );
return;
}
if ( fwrite( buf, 1, len, f ) != len ) {
Expand Down

0 comments on commit e72fcbd

Please sign in to comment.