Commit b9dc29f1 authored by Rémi Duraffort's avatar Rémi Duraffort

Fix potential memleak (CID 69)

parent 888c97bb
......@@ -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];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment