Unlikely memory leak - fixes #2256
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Wed, 29 Oct 2008 20:28:18 +0000 (22:28 +0200)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Wed, 29 Oct 2008 20:28:18 +0000 (22:28 +0200)
modules/video_output/snapshot.c

index 08d4381..118e65a 100644 (file)
@@ -275,7 +275,10 @@ static int Init( vout_thread_t *p_vout )
         p_snapshot->date = 0;
         p_snapshot->p_data = ( char* ) malloc( i_datasize );
         if( p_snapshot->p_data == NULL )
+        {
+            free( p_snapshort );
             return VLC_ENOMEM;
+        }
         p_vout->p_sys->p_list[i_index] = p_snapshot;
     }