gnucash maint: Bug 770196 - cppcheck va_list not closed

John Ralls jralls at code.gnucash.org
Mon Aug 22 17:37:16 EDT 2016


Updated	 via  https://github.com/Gnucash/gnucash/commit/4d8d7ed5 (commit)
	from  https://github.com/Gnucash/gnucash/commit/a0a69327 (commit)



commit 4d8d7ed546852c99669ba76d937f4050ea803ca7
Author: Pierre-André Jacquod <pjacquod at gmx.ch>
Date:   Mon Aug 22 21:14:29 2016 +0200

    Bug 770196 - cppcheck va_list not closed
    
    c/backend/xml/sixtp.c:173]: (error) va_list 'ap' was opened
    but not closed by va_end() in case tochange pointer was NULL

diff --git a/src/backend/xml/sixtp.c b/src/backend/xml/sixtp.c
index 0377274..bf13b98 100644
--- a/src/backend/xml/sixtp.c
+++ b/src/backend/xml/sixtp.c
@@ -165,14 +165,14 @@ sixtp_set_any(sixtp *tochange, int cleanup, ...)
     va_list ap;
     sixtp_handler_type type;
 
-    va_start(ap, cleanup);
-
     if (!tochange)
     {
         g_warning("Null tochange passed");
         return NULL;
     }
 
+    va_start(ap, cleanup);
+
     do
     {
         type = va_arg(ap, sixtp_handler_type);



Summary of changes:
 src/backend/xml/sixtp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



More information about the gnucash-changes mailing list