mirror of
https://github.com/transmission/transmission
synced 2024-12-26 09:37:56 +00:00
fix memory error reported by John_Clay
This commit is contained in:
parent
930199dbeb
commit
7ce8312ddc
1 changed files with 3 additions and 3 deletions
|
@ -133,9 +133,9 @@ TrOpenFile( int i, const char * filename, int write )
|
||||||
|
|
||||||
/* create subfolders, if any */
|
/* create subfolders, if any */
|
||||||
if( write ) {
|
if( write ) {
|
||||||
char * dir = dirname( tr_strdup( filename ) );
|
char * tmp = tr_strdup( filename );
|
||||||
const int val = tr_mkdirp( dir, 0700 );
|
const int val = tr_mkdirp( dirname(tmp), 0700 );
|
||||||
tr_free( dir );
|
tr_free( tmp );
|
||||||
if( val )
|
if( val )
|
||||||
return tr_ioErrorFromErrno( );
|
return tr_ioErrorFromErrno( );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue