mirror of
https://github.com/transmission/transmission
synced 2025-02-21 13:46:52 +00:00
(trunk libT) #3860 "memory leak in torrentCallScript" -- patched.
This commit is contained in:
parent
770ab426f6
commit
123ad33ce4
1 changed files with 4 additions and 0 deletions
|
@ -1926,6 +1926,7 @@ torrentCallScript( const tr_torrent * tor, const char * script )
|
|||
|
||||
if( script && *script )
|
||||
{
|
||||
int i;
|
||||
char * cmd[] = { tr_strdup( script ), NULL };
|
||||
char * env[] = {
|
||||
tr_strdup_printf( "TR_APP_VERSION=%s", SHORT_VERSION_STRING ),
|
||||
|
@ -1944,6 +1945,9 @@ torrentCallScript( const tr_torrent * tor, const char * script )
|
|||
execve( script, cmd, env );
|
||||
_exit( 0 );
|
||||
}
|
||||
|
||||
for( i=0; cmd[i]; ++i ) tr_free( cmd[i] );
|
||||
for( i=0; env[i]; ++i ) tr_free( env[i] );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue