From: RĂ©mi Duraffort Date: Mon, 5 Jul 2010 18:10:17 +0000 (+0200) Subject: mp4: fix a memory leak and an invalid release in MacOS code. X-Git-Tag: 1.2.0-pre1~5938 X-Git-Url: https://git.sesse.net/?p=vlc;a=commitdiff_plain;h=3fc54c1ac1b1114d88c9ca782de378a0497c0272 mp4: fix a memory leak and an invalid release in MacOS code. --- diff --git a/modules/demux/mp4/drms.c b/modules/demux/mp4/drms.c index 35d605729e..9a29f7c1e9 100644 --- a/modules/demux/mp4/drms.c +++ b/modules/demux/mp4/drms.c @@ -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 ); }