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

Is that a memory leak? #54

Closed
dgrr opened this issue Oct 21, 2019 · 2 comments
Closed

Is that a memory leak? #54

dgrr opened this issue Oct 21, 2019 · 2 comments

Comments

@dgrr
Copy link

dgrr commented Oct 21, 2019

Hello,

I think this part of the code is affected by a memory leak.
In the pointed functions, you're using result but you're not freeing it. I don't know completely if that's a memory leak, but as I see how xlsxioread_sheet_next_cell works, I think it is. Correct me if I am wrong.

Thanks.

@brechtsanders
Copy link
Owner

Hi,
XLSXIOCHAR* xlsxioread_sheet_next_cell (xlsxioreadersheet sheethandle) returns a string which the caller needs to call free() on, so the function does exit without releasing that memory.
But it's up to the caller to release it to prevent memory leaks in this case.
So I did notice that xlsxioread_sheet_next_cell_int/xlsxioread_sheet_next_cell_float/xlsxioread_sheet_next_cell_datetime didn't call free(result);
I have added it now in master.
Thanks for spotting this.
Brecht

@brechtsanders
Copy link
Owner

Fixed in release 0.2.25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants