TetherController - fix missing calls to posix_*_destroy() on error paths
This fixes a couple cases were errors can result in a missing calls to:
posix_spawnattr_destroy(&attr);
posix_spawn_file_actions_destroy(&fa);
which potentially results in a memory leak.
It's hard to accomplish this with helper functions, because if init fails,
you shouldn't call destroy, but if adddup2/setflags fails you need to...
Test: atest clatd_test libbpf_android_test libnetdbpf_test netd_integration_test netd_unit_test netdutils_test resolv_integration_test resolv_unit_test
Signed-off-by:
Maciej Żenczykowski <maze@google.com>
Change-Id: If6e5d778e16e2ab69cd5f7d75824f320e1b0888c
Loading
Please register or sign in to comment