From 43701e2482f1e66f483ec79169737c575b1759ea Mon Sep 17 00:00:00 2001 From: tradke Date: Fri, 18 Jan 2002 16:06:47 +0000 Subject: Fixed small memory leak. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOBasic/trunk@112 b589c3ab-70e8-4b4d-a09f-cba2dd200880 --- src/OutputInfo.c | 6 ++++-- src/OutputScalar.c | 11 +++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'src') 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); } -- cgit v1.2.3