From d7f5e7e04adf607a5f82185777a2167bfde20fff Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 30 Jan 2018 11:57:11 +0000 Subject: coverity#1421119 Dereference after null check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic5002a25ed51fe72e1f36f365707101632d786e1 Reviewed-on: https://gerrit.libreoffice.org/48905 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- connectivity/source/parse/sqlflex.l | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'connectivity/source') diff --git a/connectivity/source/parse/sqlflex.l b/connectivity/source/parse/sqlflex.l index 5d8a59c27844..9bbf3d173b67 100644 --- a/connectivity/source/parse/sqlflex.l +++ b/connectivity/source/parse/sqlflex.l @@ -84,11 +84,17 @@ OSQLScanner* xxx_pGLOBAL_SQLSCAN = nullptr; result = (c == EOF) ? YY_NULL : (buf[0] = c, 1);\ } -#define YY_FATAL_ERROR(msg) \ -{ \ - xxx_pGLOBAL_SQLSCAN->SQLyyerror(msg); \ - /*hack to silence -Wunused-function*/ \ - if (0) yy_fatal_error(msg); \ +// coverity[+kill] +static void do_fatal_error(const char* msg) +{ + xxx_pGLOBAL_SQLSCAN->SQLyyerror(msg); + /*hack to silence -Wunused-function*/ + if (0) yy_fatal_error(msg); +} + +#define YY_FATAL_ERROR(msg) \ +{ \ + do_fatal_error(msg); \ } %} -- cgit