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

Memory leak warning from clang scan-build #4

Open
mvtiaine opened this issue Nov 3, 2023 · 0 comments
Open

Memory leak warning from clang scan-build #4

mvtiaine opened this issue Nov 3, 2023 · 0 comments

Comments

@mvtiaine
Copy link

mvtiaine commented Nov 3, 2023

Hi,

I recently added libdigibooster3 support to my Audacious UADE plugin https://github.com/mvtiaine/audacious-uade
Works great!

Building with clang scan-build though it reported couple of issues that may be of interest.

This looks like real memory leak to me, at least I can't figure out how struct Echo *obj would not leak. Besides leaking, it mostly looks like dead code also?

https://github.com/grzegorz-kraszewski/libdigibooster3/blob/master/dsp_echo.c#L261

3rdparty/dbm/dsp_echo.c:263:9: warning: Potential leak of memory pointed to by 'obj' [unix.Malloc]
  263 |         return NULL;

There are also couple of more dead code warnings, but don't look that serious:

https://github.com/grzegorz-kraszewski/libdigibooster3/blob/master/dsp_echo.c#L129

3rdparty/dbm/dsp_echo.c:130:3: warning: Value stored to 'leave_active' is never read [deadcode.DeadStores]
  130 |                 leave_active = prev->dsp_pull(prev, b, chunk);

https://github.com/grzegorz-kraszewski/libdigibooster3/blob/master/loader.c#L282

3rdparty/dbm/loader.c:283:7: warning: Although the value stored to 'k' is used in the enclosing expression, the value is never actually read from 'k' [deadcode.DeadStores]
  283 |                 if (k = ah->ah_Read(ah, buf, length)) dc->Pos += length;
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

1 participant