accel-sim / gpu-app-collection

A repository where GPU applications are aggregated using a common build flow that supports multiple CUDA versions.
44 stars 32 forks source link

dwt2d: fix memory leak in filename malloc #6

Closed mattsinc closed 2 years ago

mattsinc commented 2 years ago

The malloc for the imgsrc filename in dwt2d leaks memory because it does not allocate space for the trailing \0 to end the string. This commit fixes that.

mattsinc commented 2 years ago

I confirmed these with valgrind -- putting in the changes made the leaks go away.

tgrogers commented 2 years ago

Thanks, Matt. Good old strlen :) Can you merge this into dev - then we can get it in the next release?

mattsinc commented 2 years ago

Better?