magic/plow
Darryl L. Miles e88dcba1c5 CodeQL File{MayNot,Never}BeClosed.ql file-handle resource leaks
Guided by CodeQL static code analyser.

FileMayNotBeClosed.ql
FileMayNeverBeClosed.ql

The trick with "if(fp != stdout)" is problematic (to analyser) as
technically 'stdout' can be a global pointer that COULD be modified any
time, so it might have changed between the fopen() and fclose() calls so
the close MAY NEVER occurs (which is problem the analyzer can see).

So local state is maintained as a bool which will also clarify to the
compiler see the intention without concern for external stdout
modification.

Some items appear to be out and out leaks when certain commands are use.
2025-02-22 21:02:49 -05:00
..
Makefile Initial commit at Tue Apr 25 08:41:48 EDT 2017 by tim on stravinsky 2017-04-25 08:41:48 -04:00
PlowCmd.c Plow() pass by-pointer const TileTypeBitMask* instead of by-value 2025-02-22 20:58:59 -05:00
PlowJogs.c plowSrShadowBack() pass by-pointer const TileTypeBitMask* instead of by-value 2025-02-22 20:58:59 -05:00
PlowMain.c plowInitRule() pass by-pointer const TileTypeBitMask* instead of by-value 2025-02-22 20:58:59 -05:00
PlowQueue.c Updates from running the fix-ending-whitespace script. 2020-05-23 17:13:14 -04:00
PlowRandom.c Plow() pass by-pointer const TileTypeBitMask* instead of by-value 2025-02-22 20:58:59 -05:00
PlowRules1.c plowSrShadow() pass by-pointer const TileTypeBitMask* instead of by-value 2025-02-22 20:58:59 -05:00
PlowRules2.c plowSrShadow() pass by-pointer const TileTypeBitMask* instead of by-value 2025-02-22 20:58:59 -05:00
PlowRules3.c plowSrShadow() pass by-pointer const TileTypeBitMask* instead of by-value 2025-02-22 20:58:59 -05:00
PlowSearch.c plowSrShadowXxx() callback plowShowShadow() correct return type 2025-02-22 20:58:59 -05:00
PlowTech.c LookupStruct() constify call-site 2024-12-26 15:20:58 -05:00
PlowTest.c CodeQL File{MayNot,Never}BeClosed.ql file-handle resource leaks 2025-02-22 21:02:49 -05:00
PlowWidth.c plowFindWidthBack() pass by-pointer const TileTypeBitMask* instead of by-value 2025-02-22 20:58:59 -05:00
PlowYank.c TCL9: ClientData macro assignment and access usage 2025-01-04 11:08:01 -05:00
TODO Initial commit at Tue Apr 25 08:41:48 EDT 2017 by tim on stravinsky 2017-04-25 08:41:48 -04:00
plow.h Plow() pass by-pointer const TileTypeBitMask* instead of by-value 2025-02-22 20:58:59 -05:00
plowDebugInt.h Updates from running the fix-ending-whitespace script. 2020-05-23 17:13:14 -04:00
plowInt.h plowInitRule() pass by-pointer const TileTypeBitMask* instead of by-value 2025-02-22 20:58:59 -05:00