Valgrind run:
valgrind --leak-check=full build/ani change AGBLQOQIB6DSD2APO6L2PLFXF7CRWKAD6VAWIAD6F2DTH4EIRYRQC
==3651== Memcheck, a memory error detector
==3651== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==3651== Using Valgrind-3.20.0 and LibVEX; rerun with -h for copyright info
==3651== Command: build/ani change AGBLQOQIB6DSD2APO6L2PLFXF7CRWKAD6VAWIAD6F2DTH4EIRYRQC
==3651==
message = contrib/pijul-status: print all-ok message when no changes detected
timestamp = '2022-09-27T12:12:18.246927153Z'
[[authors]]
key = 'AFgzZkD8ARgC21gkkCvxPV5HbL7YDVzgYEhbAxQG7UQY'
# Dependencies
4DUOW3T334XG5GYSY4HTQJAZ2JCBAYUBHWLKJ7PKQXGVMA2WZFWQC
+5YTX4YURTNMDR6W725M6XZUEKYC7PCBUJAITEFT7KQKZ6RGJDYGQC
# Hunks
1. edit in contrib/pijul-status:42 (UTF-8)
-
2. edit in contrib/pijul-status:47 (UTF-8)
up: P0.1486, new: 0:88, down: P0.1486
+ }
+ if (ci == 0 && ui == 0) {
+ printf("nothing to record, working copy clean\n")
==3651==
==3651== HEAP SUMMARY:
==3651== in use at exit: 7,603 bytes in 21 blocks
==3651== total heap usage: 94 allocs, 73 frees, 29,732,931 bytes allocated
==3651==
==3651== 26 bytes in 1 blocks are definitely lost in loss record 10 of 21
==3651== at 0x48417E4: malloc (vg_replace_malloc.c:393)
==3651== by 0x49D5C99: strdup (strdup.c:42)
==3651== by 0x14032A: xstrdup (scaffold.c:71)
==3651== by 0x140008: find_dotpijul (dir.c:59)
==3651== by 0x115DDE: cmd_main (ani.c:74)
==3651== by 0x115E4A: main (ani.c:87)
==3651==
==3651== 7,577 (6,912 direct, 665 indirect) bytes in 1 blocks are definitely lost in loss record 21 of 21
==3651== at 0x48417E4: malloc (vg_replace_malloc.c:393)
==3651== by 0x140290: xmalloc (scaffold.c:49)
==3651== by 0x118477: changestoreinit (change.c:912)
==3651== by 0x118A32: change (change.c:1065)
==3651== by 0x118E23: cmd_change (change.c:1156)
==3651== by 0x115E18: cmd_main (ani.c:78)
==3651== by 0x115E4A: main (ani.c:87)
==3651==
==3651== LEAK SUMMARY:
==3651== definitely lost: 6,938 bytes in 2 blocks
==3651== indirectly lost: 665 bytes in 19 blocks
==3651== possibly lost: 0 bytes in 0 blocks
==3651== still reachable: 0 bytes in 0 blocks
==3651== suppressed: 0 bytes in 0 blocks
==3651==
==3651== For lists of detected and suppressed errors, rerun with: -s
==3651== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
The command:
valgrind --leak-check=full build/ani change AGBLQOQIB6DSD2APO6L2PLFXF7CRWKAD6VAWIAD6F2DTH4EIRYRQC
now reports all allocated resources freed! Other tests also report all good, so closing this for now.
We haven’t been too careful about resource management after change() is done - we should ensure that all resources are properly released, both on success and failure.