On Wed, Jun 26, 2024 at 1:52 PM Karthik Nayak <karthik.188@xxxxxxxxx> wrote: > But to summarize, seems like we're not sure why this was added. CC'ing > Han-Wen here incase he remembers the intent. The copy functions are like C++ copy constructors. They discard the old data, and copy over the new data into the destination. If we forget to free() something in the "discard old data" step, that would be exercised by initializing the record to hold data (1st copy call) and then triggering the cleanup (2nd copy call.). Valgrind or similar tooling would then detect the leak. -- Han-Wen Nienhuys - hanwenn@xxxxxxxxx - http://www.xs4all.nl/~hanwen