aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorallen <allen@eff87b29-5268-4891-90a3-a07138403961>2000-09-21 09:02:47 +0000
committerallen <allen@eff87b29-5268-4891-90a3-a07138403961>2000-09-21 09:02:47 +0000
commit5929b97f708952c6bf22ccca094aa3cee27a64e4 (patch)
treeaf5c2fc6e653ff35de2592b6a9a87012e0d96d1e /src
parent561719d9600d3e28bdca4f139333b95cfce6dd91 (diff)
Fixed big memory leak, I think there's still something left though.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusIO/IOJpeg/trunk@12 eff87b29-5268-4891-90a3-a07138403961
Diffstat (limited to 'src')
-rw-r--r--src/DumpVar.c6
-rw-r--r--src/Write2D.c8
2 files changed, 11 insertions, 3 deletions
diff --git a/src/DumpVar.c b/src/DumpVar.c
index 96613da..8ebee86 100644
--- a/src/DumpVar.c
+++ b/src/DumpVar.c
@@ -104,6 +104,11 @@ int IOJpeg_DumpVar (cGH *GH, int index, int timelevel, IOJpegGeo_t *geo, FILE *f
if (data)
free (data);
+ if (hsize)
+ {
+ free (hsize);
+ }
+
return (0);
}
@@ -150,6 +155,7 @@ int IOJpeg_Output(cGH *GH, int index, int timelevel, CCTK_REAL *data,
colormap_quality,
fid);
+ free(dataout);
return(1);
}
diff --git a/src/Write2D.c b/src/Write2D.c
index 0eb0970..6260c89 100644
--- a/src/Write2D.c
+++ b/src/Write2D.c
@@ -62,11 +62,13 @@ int IOJpeg_Write2D (cGH *GH, int index, const char *alias)
/* see if output file for this alias name was already created */
fdset_2D = (FILE **) GetNamedData (ssGH->fileList_2D, alias);
- /* if (fdset_2D == NULL) */
{
char *fname;
-
- fdset_2D = (FILE **) malloc (max_slabs * sizeof (FILE *));
+
+ if (!fdset_2D)
+ {
+ fdset_2D = (FILE **) malloc (max_slabs * sizeof (FILE *));
+ }
fname = (char *) malloc ((strlen (ssGH->outdir2D) +
strlen (alias) + 20)*sizeof(char));