[vlc-commits] commit: mp4: fix a memory leak and an invalid release in MacOS code. ( Rémi Duraffort )
git at videolan.org
git at videolan.org
Wed Jul 7 19:23:05 CEST 2010
vlc/vlc-1.1 | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Jul 5 20:10:17 2010 +0200| [01390cc16f37e2ab61b2c8800fbfe928ccaacfb2] | committer: Rémi Duraffort
mp4: fix a memory leak and an invalid release in MacOS code.
(cherry picked from commit 3fc54c1ac1b1114d88c9ca782de378a0497c0272)
Signed-off-by: Rémi Duraffort <ivoire at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=01390cc16f37e2ab61b2c8800fbfe928ccaacfb2
---
modules/demux/mp4/drms.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/modules/demux/mp4/drms.c b/modules/demux/mp4/drms.c
index 35d6057..9a29f7c 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 );
}
More information about the vlc-commits
mailing list