[vlc-commits] extension: fix a potential memleak.
Rémi Duraffort
git at videolan.org
Sun Jan 23 10:37:12 CET 2011
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sun Jan 23 10:24:08 2011 +0100| [2a7cdd592ae8eb33f9c47832655968bc7aea9e5a] | committer: Rémi Duraffort
extension: fix a potential memleak.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2a7cdd592ae8eb33f9c47832655968bc7aea9e5a
---
modules/misc/lua/extension.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/modules/misc/lua/extension.c b/modules/misc/lua/extension.c
index 521117b..541d06c 100644
--- a/modules/misc/lua/extension.c
+++ b/modules/misc/lua/extension.c
@@ -304,7 +304,10 @@ int ScanLuaCallback( vlc_object_t *p_this, const char *psz_filename,
/* Create new script descriptor */
extension_t *p_ext = ( extension_t* ) calloc( 1, sizeof( extension_t ) );
if( !p_ext )
+ {
+ free( psz_script );
return 0;
+ }
p_ext->psz_name = psz_script;
p_ext->p_sys = (extension_sys_t*) calloc( 1, sizeof( extension_sys_t ) );
More information about the vlc-commits
mailing list