3 ms·
you put a cleanup label at the end and in case of any error set the return code and jump there, where all the buffers get freed. Otherwise you have to free all
by bombolo 3y ago
you put a cleanup label at the end and in case of any error set the return code and jump there, where all the buffers get freed.
Otherwise you have to free all the buffers in every place where an error might happen, and you will most likely forget to free some or double-free.