Skip to content

Fix some memory leaks

bob requested to merge bob131/libipuz:fix-memleaks into master

This commit fixes a handful of memory leaks, found via Valgrind's memcheck and visual inspection:

  • libipuz/ipuz-board.c (ipuz_board_finalize): Add a missing chain-up to the parent finalize implementation. Found by memcheck. Fixes 5f06d111.

  • libipuz/ipuz-clue.c (ipuz_clue_copy): Unref the initial empty array created by ipuz_clue_new before assigning a newly copied array. Found by memcheck. Fixes dd6965dd.

  • libipuz/ipuz-crossword.c (ipuz_crossword_new): Delete double-initialisation of new IpuzCrossword instances. Found by memcheck. Fixes 4b52bd1b.

  • libipuz/ipuz-puzzle.c (ipuz_puzzle_finalize): Free checksum_salt field. Found by audit; the field is currently unused, so this isn't strictly a leak at the moment. Fixes 7a7a1d51 and 212751d2 (kinda).

  • libipuz/ipuz-style.c (ipuz_style_unref): Make sure to free text_color. Found by memcheck. Fixes 4cebffe9.

Merge request reports