From 0ec9ee15c8f3cb3f495e767ccbd9ce52ac1c4d26 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Fri, 8 Jan 2010 14:24:47 -0500 Subject: [svn-r18084] Fix coverity item 269 + others. When a error occurred in a function using the h5tools error framework, the "past_catch" variable would not be set to true because that statement was before the label that goto jumped to. This could cause a failure in the cleanup section to go back to the start of the section, freeing variables twice, etc. Moved the label infront of past_catch=TRUE. Tested: Fedora --- tools/lib/h5tools_error.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h index da8f03c..dc5f87b 100644 --- a/tools/lib/h5tools_error.h +++ b/tools/lib/h5tools_error.h @@ -71,7 +71,7 @@ extern hid_t H5E_tools_min_id_g; /* Macro for "catching" flow of control when an error occurs. Note that the * H5_LEAVE macro won't jump back here once it's past this point. */ -#define CATCH past_catch = TRUE; catch_except:; +#define CATCH catch_except:; past_catch = TRUE; /* * H5_LEAVE macro, used to facilitate control flow between a -- cgit v0.12