On Wed, 13 Dec 2023 12:22:45 +0100 Martin Mareš <mj@xxxxxx> wrote: > > I think that die() from common.c is not suitable here, as the utility at that > > moment in the code still can and must free up resources malloc'ed in the main > > function. > > I don't understand why this is needed -- once the process exits, all memory > allocated by it is freed by the kernel. Well, yes, I suppose in case of most modern operating systems you are right. This particular function, about which this thread is about, was conceived as an optional method to save the results of the utility to a file. According to the logic of the utility, by this point the testing process has already been successfully completed and it seemed to me that the utility should no longer panic. On the other hand, it makes sense to return a non-zero code to the user if something went wrong. In fact, there are a few more cases in the main function of the utility when some checks fail and the utility may exit. If we are satisfied with the option when the utility does not clean up gracefully, I can use die() in such cases. Best regards, Nikita Proshkin