From f690aeb603dbe72f134eb53a78c1568a96d4f546 Mon Sep 17 00:00:00 2001 From: Dave Beckett Date: Sun, 21 Nov 2021 21:51:02 -0800 Subject: Add va_end to turtle_parser_error_simple error paths (turtle_parser_error_simple): Ensure va_end is always called on all normal and error paths. [coverity CID 343351] --- src/turtle_parser.y | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/turtle_parser.y b/src/turtle_parser.y index d18e68e9..1474a3db 100644 --- a/src/turtle_parser.y +++ b/src/turtle_parser.y @@ -1334,11 +1334,11 @@ turtle_parser_error_simple(void* user_data, const char *msg, ...) !turtle_parser->is_end) { /* we encountered an error on or around the last byte of the buffer * sorting it in the next run aye? */ - return; + goto tidy; } if(turtle_parser->error_count++) - return; + goto tidy; rdf_parser->locator.line = turtle_parser->lineno; #ifdef RAPTOR_TURTLE_USE_ERROR_COLUMNS @@ -1348,6 +1348,9 @@ turtle_parser_error_simple(void* user_data, const char *msg, ...) raptor_log_error_varargs(rdf_parser->world, RAPTOR_LOG_LEVEL_ERROR, &rdf_parser->locator, msg, args); + +tidy: + va_end(args); } -- cgit v1.2.1