Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leak in some variorum JSON examples. #569

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/examples/variorum-get-energy-json-example.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ int main(int argc, char **argv)
/* Print the entire JSON object */
puts(s);

/* Deallocate the string */
free(s);

#ifdef SECOND_RUN
for (i = 0; i < size; i++)
{
Expand Down
3 changes: 3 additions & 0 deletions src/examples/variorum-get-power-json-example.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ int main(int argc, char **argv)
/* Print the entire JSON object */
puts(s);

/* Deallocate the string */
free(s);

#ifdef SECOND_RUN
for (i = 0; i < size; i++)
{
Expand Down
3 changes: 3 additions & 0 deletions src/examples/variorum-get-utilization-json-example.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ int main(int argc, char **argv)
/* Print the entire JSON object */
puts(s);

/* Deallocate the string */
free(s);

#ifdef SECOND_RUN
for (i = 0; i < size; i++)
{
Expand Down
3 changes: 3 additions & 0 deletions src/examples/variorum-integration-using-json-example.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ int main(void)
puts(s);
parse_json_power_obj(s, num_sockets);

/* Deallocate the string */
free(s);

#ifdef SECOND_RUN
for (i = 0; i < size; i++)
{
Expand Down
Loading