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 vx_data2d_grib2 library. #1157

Closed
JohnHalleyGotway opened this issue Jun 28, 2019 · 1 comment
Closed

Fix memory leak in vx_data2d_grib2 library. #1157

JohnHalleyGotway opened this issue Jun 28, 2019 · 1 comment
Assignees
Labels
MET: Library Code type: bug Fix something that is not working

Comments

@JohnHalleyGotway
Copy link
Collaborator

During development for the tcrmw tool, David found a memory leak in the vx_data2d_grib2 library. The read_grib2_record() function allocates an array of unsigned char's for storing the contents of GRIB2 records. However, it fails to deallocate.

The pointer for this memory is passed as an argument to this function, but that isn't necessary. Update the code to declare the pointer locally, allocated, and deallocate before returning.

@JohnHalleyGotway
Copy link
Collaborator Author

Fixed in the master_v8.1 and develop branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MET: Library Code type: bug Fix something that is not working
Projects
None yet
Development

No branches or pull requests

1 participant