I'm sorry, I totally do not get it the problem with -- in general -- writing the code in such a way that it properly frees any allocations it made.
I suspect there will be corner cases where it will be really hard, and we can discuss those separately. But discussing about adding a free() in ps? (If it was done incorrectly, let's fix it.) Please enlighten me. Thomas