aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortradke <tradke@ff385933-4943-42dc-877b-ffc776028de6>2003-07-08 10:04:17 +0000
committertradke <tradke@ff385933-4943-42dc-877b-ffc776028de6>2003-07-08 10:04:17 +0000
commitafffaf16a0819e20ce3d0b6de71f3829d8e6219d (patch)
treeb7720f8fe7251227b29f53d71054d1c1d4882bf9 /src
parent491443b65eeb3ff8990cad37296b4955d7182474 (diff)
Fix a memory leak in PrintWarning().
This closes PR CactusUtils/1558. git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/NaNChecker/trunk@45 ff385933-4943-42dc-877b-ffc776028de6
Diffstat (limited to 'src')
-rw-r--r--src/NaNCheck.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/src/NaNCheck.c b/src/NaNCheck.c
index d7827f0..591bcca 100644
--- a/src/NaNCheck.c
+++ b/src/NaNCheck.c
@@ -500,7 +500,7 @@ static void PrintWarning (const char *error_type,
"%s caught in %svariable '%s'",
error_type, complex_part, fullname);
}
- else
+ else if (verbose)
{
/* assume max. 10 characters per index number and 40 characters per
coordinate value (including separators) */
@@ -527,24 +527,21 @@ static void PrintWarning (const char *error_type,
}
}
- if (verbose)
+ if (coords)
{
- if (coords)
- {
- CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING,
- "%s caught in %svariable '%s' at index (%s) with coordinates "
- "(%s)", error_type, complex_part, fullname, index_string,
- coord_string);
- }
- else
- {
- CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING,
- "%s caught in %svariable '%s' at (%s)",
- error_type, complex_part, fullname, index_string);
- }
-
- free (index_string);
+ CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "%s caught in %svariable '%s' at index (%s) with coordinates "
+ "(%s)", error_type, complex_part, fullname, index_string,
+ coord_string);
+ }
+ else
+ {
+ CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "%s caught in %svariable '%s' at (%s)",
+ error_type, complex_part, fullname, index_string);
}
+
+ free (index_string);
}
}