Skip to content
New issue

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

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

Already on GitHub? # to your account

[ FF7 ] Memory leak with the flevel chunking code #768

Closed
DLPB2 opened this issue Dec 25, 2024 · 1 comment
Closed

[ FF7 ] Memory leak with the flevel chunking code #768

DLPB2 opened this issue Dec 25, 2024 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@DLPB2
Copy link

DLPB2 commented Dec 25, 2024

Hi, when I use someone else's code, then it's only fair for me to help out if I spot a problem with it.

Your code has memory leak for function "int ff7_read_field_file"
Line 626 in file.cpp

Specifically, you allocate memory and then allow the possibility of a return without freeing memory.

uint32_t size = lgp_get_filesize(lgp_file, 1);
char* dest = (char*)driver_malloc(size);
char* original_field_data = (char*)driver_malloc(*ff7_externals.known_field_buffer_size);
if ( !ff7_externals.field_file_buffer ) return 0;

@DLPB2 DLPB2 added the bug Something isn't working label Dec 25, 2024
@julianxhokaxhiu julianxhokaxhiu self-assigned this Feb 1, 2025
@julianxhokaxhiu julianxhokaxhiu added this to the 1.22.0 milestone Feb 1, 2025
@julianxhokaxhiu
Copy link
Owner

Thanks a lot for the feedback!

@julianxhokaxhiu julianxhokaxhiu changed the title Memory leak with the flevel chunking code [ FF7 ] Memory leak with the flevel chunking code Feb 1, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants