[vlc-devel] commit: Fix potential memleak (CID 69) ( Rémi Duraffort )
git version control
git at videolan.org
Mon Oct 6 15:46:47 CEST 2008
vlc | branch: 0.9-bugfix | Rémi Duraffort <ivoire at videolan.org> | Sun Oct 5 19:44:33 2008 +0200| [0485d0a6f6fbfa7dbc8805c1e5f9abc461fbdf03] | committer: Derk-Jan Hartman
Fix potential memleak (CID 69)
(cherry picked from commit b9dc29f14cd4fb7898e8ee29de1707722523f63c)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0485d0a6f6fbfa7dbc8805c1e5f9abc461fbdf03
---
modules/misc/xml/xtag.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/modules/misc/xml/xtag.c b/modules/misc/xml/xtag.c
index 6be8f44..602c4e5 100644
--- a/modules/misc/xml/xtag.c
+++ b/modules/misc/xml/xtag.c
@@ -644,7 +644,11 @@ static XTag *xtag_parse_tag( XTagParser *parser )
while (parser->end - s > 2) {
if (strncmp( s, "]]>", 3 ) == 0) {
if ( !(tag = malloc( sizeof(*tag))) ) return NULL;
- if ( !(pcdata = malloc( sizeof(char)*(s - parser->start + 1))) ) return NULL;
+ if ( !(pcdata = malloc( sizeof(char)*(s - parser->start + 1))) )
+ {
+ free( tag );
+ return NULL;
+ }
strncpy( pcdata, parser->start, s - parser->start );
pcdata[s - parser->start]='\0';
parser->start = s = &s[3];
More information about the vlc-devel
mailing list