Commit 01390cc1 authored by Rémi Duraffort's avatar Rémi Duraffort

mp4: fix a memory leak and an invalid release in MacOS code.

(cherry picked from commit 3fc54c1a)
Signed-off-by: default avatarRémi Duraffort <ivoire@videolan.org>
parent 6a457fe2
...@@ -1751,6 +1751,7 @@ static int GetiPodID( int64_t *p_ipod_id ) ...@@ -1751,6 +1751,7 @@ static int GetiPodID( int64_t *p_ipod_id )
CFDictionarySetValue( match_dic, CFDictionarySetValue( match_dic,
CFSTR(kIOPropertyMatchKey), CFSTR(kIOPropertyMatchKey),
smatch_dic ); smatch_dic );
CFRelease( smatch_dic );
if( IOServiceGetMatchingServices( port, match_dic, if( IOServiceGetMatchingServices( port, match_dic,
&iterator ) == KERN_SUCCESS ) &iterator ) == KERN_SUCCESS )
...@@ -1782,8 +1783,15 @@ static int GetiPodID( int64_t *p_ipod_id ) ...@@ -1782,8 +1783,15 @@ static int GetiPodID( int64_t *p_ipod_id )
IOObjectRelease( iterator ); 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 ); mach_port_deallocate( mach_task_self(), port );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment