Modern C compilers support the cleanupattribute for automatically release resources (memory, open file descriptor, etc.) at function exit. We could use it in the p11-kit commands instead of manual cleanup, as in systemd or GLib.
It might be worth noting that we probably shouldn't use this technique in the library as it intends to be portable.
Modern C compilers support the
cleanup
attribute for automatically release resources (memory, open file descriptor, etc.) at function exit. We could use it in thep11-kit
commands instead of manual cleanup, as in systemd or GLib.It might be worth noting that we probably shouldn't use this technique in the library as it intends to be portable.