aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/WriteScalar.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/WriteScalar.c b/src/WriteScalar.c
index 8528bb8..981f30e 100644
--- a/src/WriteScalar.c
+++ b/src/WriteScalar.c
@@ -334,13 +334,16 @@ static FILE *OpenScalarFile (cGH *GH,
char comment_char, buffer[128];
ioAdvertisedFileDesc advertised_file;
iobasicGH *myGH;
- char *openmode;
+ char *openmode, *fullname;
struct stat fileinfo;
/* get the GH extension handle for IOBasic */
myGH = (iobasicGH *) CCTK_GHExtension (GH, "IOBasic");
+ /* get the variable's full name */
+ fullname = CCTK_FullName (vindex);
+
/* see if output files for this alias name were already created */
if (GetNamedData (myGH->filenameListScalar, filename) == NULL)
{
@@ -375,10 +378,10 @@ static FILE *OpenScalarFile (cGH *GH,
StoreNamedData (&myGH->filenameListScalar, filename, (void *) 1);
/* advertise the file for downloading */
- advertised_file.slice = strdup (slicename);
+ advertised_file.slice = slicename;
advertised_file.thorn = CCTK_THORNSTRING;
- advertised_file.varname = CCTK_FullName (vindex);
- advertised_file.description = strdup (description);
+ advertised_file.varname = fullname;
+ advertised_file.description = description;
IOUtil_AdvertiseFile (GH, filename, &advertised_file);
@@ -407,9 +410,7 @@ static FILE *OpenScalarFile (cGH *GH,
}
fprintf (file, "%c%s v time\n", comment_char, aliasname);
- free (advertised_file.description);
- free (advertised_file.varname);
- free (advertised_file.slice);
+ free (fullname);
}
return (file);