summaryrefslogtreecommitdiff
path: root/profile.c
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <sandmann@daimi.au.dk>2009-08-17 08:19:38 -0400
committerSøren Sandmann Pedersen <sandmann@daimi.au.dk>2009-08-17 08:19:38 -0400
commit79921d709844bd35d307f5754faa285702463491 (patch)
tree1bb82f8b570a2b5ea992bbc70f483e855720f3b6 /profile.c
parent9774bca836fe730fdf4af194a51b9062c05e8ea3 (diff)
Free the sfile formats after freeing the input/output files.
The instruction arrays in the files have a references to types that are owned by the formats, so if the formats are freed first, valgrind complains about invalid accesses during the freeing of the instruction array.
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/profile.c b/profile.c
index 41c70fc..5fda470 100644
--- a/profile.c
+++ b/profile.c
@@ -142,8 +142,8 @@ profile_save (Profile *profile,
result = sfile_output_save (output, file_name, err);
- sformat_free (format);
sfile_output_free (output);
+ sformat_free (format);
return result;
}
@@ -214,8 +214,8 @@ profile_load (const char *filename, GError **err)
sfile_end_get (input, "nodes", NULL);
sfile_end_get (input, "profile", NULL);
- sformat_free (format);
sfile_input_free (input);
+ sformat_free (format);
stack_stash_set_root (profile->stash, root);