mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
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.
This commit is contained in:
@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user