Skip to content

Commit

Permalink
fix memory leak in json encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
babongo committed Oct 16, 2010
1 parent 93e8e99 commit 5b5f632
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion example/json/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ int simple_array (void)

for (l = 0; l < 10 ; l++)
{
con_err_if (u_json_new_int(NULL, l, &tmp));
con_err_if (u_json_new_real(NULL, 10 * exp((double) (l * 50)), &tmp));
con_err_if (u_json_add(root, tmp));
tmp = NULL;
Expand Down
2 changes: 2 additions & 0 deletions srcs/toolbox/json.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,10 @@ int u_json_set_val_ex (u_json_t *jo, const char *val, char check)

/* Fall through. */
end:
u_lexer_free(vl);
return 0;
err:
u_lexer_free(vl);
return ~0;
}
/**
Expand Down

0 comments on commit 5b5f632

Please sign in to comment.