summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Beckett <dave@dajobe.org>2021-11-21 21:51:02 -0800
committerDave Beckett <dave@dajobe.org>2021-11-21 21:51:02 -0800
commitf690aeb603dbe72f134eb53a78c1568a96d4f546 (patch)
tree6e6eb503f7825d79eb656c61b619662de23454f6
parent2febf90393888b6483dab78837da9435ab9414e5 (diff)
downloadraptor-f690aeb603dbe72f134eb53a78c1568a96d4f546.tar.gz
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]
-rw-r--r--src/turtle_parser.y7
1 files 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);
}