Avoid malloc/free in capng_apply (#16)
Avoid malloc/free in capng_apply (#16)

POSIX does not mandate malloc() to be async-safe so calling malloc()
from child after fork may result in a deadlock. This resulted in
libvirtd deadlock with musl libc due to a call to capng_apply.

Fix this by storing the state on stack instead of using
capng_save_state().

Ref: https://gitlab.alpinelinux.org/alpine/aports/-/issues/11602
stevegrubb/libcap-ng,stevegrubb/libcap-ng,stevegrubb/libcap-ng