]> granicus.if.org Git - transmission/commitdiff
get rid of a pointless seek() call
authorCharles Kerr <charles@transmissionbt.com>
Sat, 6 Sep 2008 03:02:30 +0000 (03:02 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Sat, 6 Sep 2008 03:02:30 +0000 (03:02 +0000)
libtransmission/utils.c

index a3178bb0fdd18a01628d9a31602e285c0d1329ec..a476a734d6bc568e6a87b897570c94e313aff643 100644 (file)
@@ -407,12 +407,11 @@ tr_loadFile( const char * path, size_t * size )
         fclose( file );
         return NULL;
     }
-    fseek( file, 0, SEEK_SET );
     if( fread( buf, sb.st_size, 1, file ) != 1 )
     {
         tr_err( err_fmt, path, tr_strerror(errno) );
-        free( buf );
         fclose( file );
+        free( buf );
         return NULL;
     }
     fclose( file );