aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880>2002-01-18 16:06:47 +0000
committertradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880>2002-01-18 16:06:47 +0000
commit43701e2482f1e66f483ec79169737c575b1759ea (patch)
tree4d8c81137f7c5e48dded9c83688b871a528ba003
parentd7fe8a33f2937629e7967b7a2eae998c40dd8e68 (diff)
Fixed small memory leak.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOBasic/trunk@112 b589c3ab-70e8-4b4d-a09f-cba2dd200880
-rw-r--r--src/OutputInfo.c6
-rw-r--r--src/OutputScalar.c11
2 files changed, 11 insertions, 6 deletions
diff --git a/src/OutputInfo.c b/src/OutputInfo.c
index 96af228..d737375 100644
--- a/src/OutputInfo.c
+++ b/src/OutputInfo.c
@@ -579,7 +579,7 @@ static void PrintHeader (iobasicGH *myGH, int num_vars)
{
DECLARE_CCTK_PARAMETERS
int i, num_columns, vindex;
- char *fullname, *msg;
+ char *fullname, *msg, *oldmsg;
iobasic_reduction_t *reduction;
@@ -601,7 +601,9 @@ static void PrintHeader (iobasicGH *myGH, int num_vars)
}
else
{
- Util_asprintf (&msg, "%s %s", msg, fullname);
+ oldmsg = msg;
+ Util_asprintf (&msg, "%s %s", oldmsg, fullname);
+ free (oldmsg);
}
free (fullname);
}
diff --git a/src/OutputScalar.c b/src/OutputScalar.c
index 663dbeb..1281cff 100644
--- a/src/OutputScalar.c
+++ b/src/OutputScalar.c
@@ -310,7 +310,7 @@ static void CheckSteerableParameters (iobasicGH *myGH)
{
int i, num_vars, out_old;
int times_set;
- char *fullname, *msg;
+ char *fullname, *msg, *oldmsg;
static int outScalar_vars_lastset = -1;
DECLARE_CCTK_PARAMETERS
@@ -342,8 +342,9 @@ static void CheckSteerableParameters (iobasicGH *myGH)
CCTK_TraverseString (outScalar_vars, SetOutputFlag, myGH->do_outScalar,
CCTK_GROUP_OR_VAR);
- if (CCTK_Equals (newverbose, "standard") ||
- CCTK_Equals (newverbose, "full"))
+ if (myGH->outScalar_every &&
+ (CCTK_Equals (newverbose, "standard") ||
+ CCTK_Equals (newverbose, "full")))
{
msg = NULL;
for (i = 0; i < num_vars; i++)
@@ -357,7 +358,9 @@ static void CheckSteerableParameters (iobasicGH *myGH)
}
else
{
- Util_asprintf (&msg, "%s %s", msg, fullname);
+ oldmsg = msg;
+ Util_asprintf (&msg, "%s %s", oldmsg, fullname);
+ free (oldmsg);
}
free (fullname);
}