From 3fc54c1ac1b1114d88c9ca782de378a0497c0272 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Duraffort?= Date: Mon, 5 Jul 2010 20:10:17 +0200 Subject: [PATCH] mp4: fix a memory leak and an invalid release in MacOS code. --- modules/demux/mp4/drms.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 ); } -- 2.39.2