Fix static analysis warnings and memory leaks (cppcheck)#133
Merged
tillkamppeter merged 18 commits intoOpenPrinting:masterfrom Mar 6, 2026
Merged
Fix static analysis warnings and memory leaks (cppcheck)#133tillkamppeter merged 18 commits intoOpenPrinting:masterfrom
tillkamppeter merged 18 commits intoOpenPrinting:masterfrom
Conversation
… in testfilters.c
…per file closure in pclmtoraster.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR resolves a series of warnings and errors caught by
cppcheckstatic analysis across the codebase.Key fixes include:
reallocmemory leak patterns (nulled but not freed upon failure) incatalog.c,filter.c,pwgtopdf.c, andtestfilters.c. Added missingpdfioFileClose()inpclmtoraster.cand freed leaked structs inbannertopdf.c.image.c,libcups2.c, andpdftopdf.c.pdfio_matrix_tvariables inpdftopdf.cby explicitly defining them as identity matrices.[invalidPrintfArgType_sint]warnings by changing%dto%uwhereunsigned intvariables were being passed inghostscript.c,pwgtopdf.c, andtest-analyze.c.cppcheck-suppresscomments for known macro-expansion false positives insfnt.candtest-analyze.cto keep CI logs clean.All changes have been tested locally and successfully compile.