]> git.sesse.net Git - vlc/commitdiff
mp4: fix a memory leak and an invalid release in MacOS code.
authorRémi Duraffort <ivoire@videolan.org>
Mon, 5 Jul 2010 18:10:17 +0000 (20:10 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Mon, 5 Jul 2010 19:09:10 +0000 (21:09 +0200)
modules/demux/mp4/drms.c

index 35d605729eeaca0ec7287d29e39a86084a448cbf..9a29f7c1e982f7d7fd3c43356fa6229a48fc9ae8 100644 (file)
@@ -1751,6 +1751,7 @@ static int GetiPodID( int64_t *p_ipod_id )
             CFDictionarySetValue( match_dic,
                                   CFSTR(kIOPropertyMatchKey),
                                   smatch_dic );
+            CFRelease( smatch_dic );
 
             if( IOServiceGetMatchingServices( port, match_dic,
                                               &iterator ) == KERN_SUCCESS )
@@ -1782,8 +1783,15 @@ static int GetiPodID( int64_t *p_ipod_id )
 
                 IOObjectRelease( iterator );
             }
-            CFRelease( match_dic );
         }
+        else
+        {
+            if( match_dic )
+                CFRelease( match_dic );
+            if( smatch_dic )
+                CFRelease( smatch_dic );
+        }
+
 
         mach_port_deallocate( mach_task_self(), port );
     }