mirror of
https://github.com/transmission/transmission
synced 2024-12-24 08:43:27 +00:00
(trunk gtk) fix a minor memory leak in gtr_open_file(). reported by clang static analyzer.
This commit is contained in:
parent
d37b29264d
commit
7e83c406d4
1 changed files with 2 additions and 3 deletions
|
@ -313,7 +313,7 @@ gtr_file_trash_or_remove( const char * filename )
|
||||||
|
|
||||||
if( !trashed ) {
|
if( !trashed ) {
|
||||||
GError * err = NULL;
|
GError * err = NULL;
|
||||||
trashed = g_file_delete( file, NULL, &err );
|
g_file_delete( file, NULL, &err );
|
||||||
if( err ) {
|
if( err ) {
|
||||||
g_message( "Unable to delete file \"%s\": %s", filename, err->message );
|
g_message( "Unable to delete file \"%s\": %s", filename, err->message );
|
||||||
g_clear_error( &err );
|
g_clear_error( &err );
|
||||||
|
@ -343,10 +343,9 @@ gtr_get_help_uri( void )
|
||||||
void
|
void
|
||||||
gtr_open_file( const char * path )
|
gtr_open_file( const char * path )
|
||||||
{
|
{
|
||||||
char * uri = NULL;
|
char * uri;
|
||||||
|
|
||||||
GFile * file = g_file_new_for_path( path );
|
GFile * file = g_file_new_for_path( path );
|
||||||
uri = g_file_get_uri( file );
|
|
||||||
g_object_unref( G_OBJECT( file ) );
|
g_object_unref( G_OBJECT( file ) );
|
||||||
|
|
||||||
if( g_path_is_absolute( path ) )
|
if( g_path_is_absolute( path ) )
|
||||||
|
|
Loading…
Reference in a new issue