j2s array and object generated code leak memory. #17

Closed
opened 2023-11-09 07:44:27 -05:00 by jordan · 0 comments
Owner

This line of j2s.c generates code that produces a memory leak. So does the analogous line for objects. It leaks a JsonValue in an effort to duplicate the data. This JsonValue should be stored in an intermediate variable and freed when it is no longer needed.

This might actually be trickier than it seems because just calling JsonValueFree() will also free the associated data, which we want to keep. We literally want to free just the JsonValue wrapper and keep the actual data inside of it.

[This line](https://git.telodendria.io/Telodendria/Cytoplasm/src/branch/master/tools/j2s.c#L663) of `j2s.c` generates code that produces a memory leak. So does the analogous line for objects. It leaks a `JsonValue` in an effort to duplicate the data. This `JsonValue` should be stored in an intermediate variable and freed when it is no longer needed. This might actually be trickier than it seems because just calling `JsonValueFree()` will also free the associated data, which we want to keep. We literally want to free *just* the `JsonValue` wrapper and keep the actual data inside of it.
jordan added the
bug
label 2023-11-09 07:44:27 -05:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Telodendria/Cytoplasm#17
No description provided.