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

Possible memory leaks in fuzzy module #2977

Closed
JAckLosingHeart opened this issue Jun 14, 2021 · 1 comment
Closed

Possible memory leaks in fuzzy module #2977

JAckLosingHeart opened this issue Jun 14, 2021 · 1 comment

Comments

@JAckLosingHeart
Copy link

JAckLosingHeart commented Jun 14, 2021

uchar *img_r = new uchar[output_height * output_width];

uchar *img_g = new uchar[output_height * output_width];

uchar *img_b = new uchar[output_height * output_width];

float *img_r = new float[output_height * output_width];

float *img_g = new float[output_height * output_width];

float *img_b = new float[output_height * output_width];

Looks like they are not de-allocated anywhere but I'm not sure about that.
Found this when running the opencv_test_fuzzy and reported by LeakSanitizer

@alalek
Copy link
Member

alalek commented Jun 14, 2021

Manual memory management (through new/delete) should be avoided.
These statements should be replaced by std::vector or cv::AutoBuffer

@berak berak mentioned this issue Jun 15, 2021
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants