Skip to content

Commit

Permalink
check return value from vasprintf
Browse files Browse the repository at this point in the history
  • Loading branch information
defunctzombie committed Dec 19, 2011
1 parent 8c34597 commit 2b18840
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/xml_sax_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -455,11 +455,10 @@ SaxParserCallback::warning(void* context,

va_list args;
va_start(args, msg);
vasprintf(&message, msg, args);
if (vasprintf(&message, msg, args) >= 0)
parser->warning(message);
va_end(args);

parser->warning(message);

free(message);
}

Expand All @@ -473,11 +472,10 @@ SaxParserCallback::error(void* context,

va_list args;
va_start(args, msg);
vasprintf(&message, msg, args);
if (vasprintf(&message, msg, args) >= 0)
parser->error(message);
va_end(args);

parser->error(message);

free(message);
}

Expand Down

0 comments on commit 2b18840

Please sign in to comment.