Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 2cffd948 authored by Maciej Żenczykowski's avatar Maciej Żenczykowski
Browse files

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: default avatarMaciej Żenczykowski <maze@google.com>
Change-Id: If6e5d778e16e2ab69cd5f7d75824f320e1b0888c
parent a1699958
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment