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 errors reported by cppcheck #595

Merged
merged 4 commits into from
Oct 18, 2024
Merged

Conversation

blapie
Copy link
Collaborator

@blapie blapie commented Oct 17, 2024

Checklist

  • I have read the contributing guidelines.
  • I have considered portability of my change across platforms and architectures.
  • I have self-reviewed my code.
  • I have commented my code where necessary.
  • I have updated the documentation accordingly.
  • I have added tests that prove my fix is effective or that my feature works.

What is the purpose of this pull request?

  • Improve code quality

What changes did you make?

This PR consists in fixing a few errors reported by cppcheck (UB, memleak, and other vulnerability)

Error: uninitialized variables
Fix: Only use mpfr_zinit when mpfr_t already initialized
Note: The use of mpfr_zinit is inconsistent anyway.
      Gencoef needs a big cleanup and possibly porting to CMake
Error: integer overflow
Fix: Use appropriate intermediate type. UL should be big enough
     on all platforms.
Error: memleakOnRealloc
Fix: Free is realloc fails (and at end of main).
Error: va_list 'ap2' was opened but not closed by va_end().
@blapie blapie merged commit 38fce14 into shibatch:master Oct 18, 2024
35 checks passed
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

Successfully merging this pull request may close these issues.

1 participant