aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-10-16 14:23:27 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-10-16 14:23:27 +0200
commitcf7ec31d2d74458781d37d52fb4245def24123e7 (patch)
tree8e1c931243a1ee672f06579d337274c140abb553 /src
parentwg-quick: android: use Binder for setting DNS on Android 10 (diff)
downloadwireguard-tools-cf7ec31d2d74458781d37d52fb4245def24123e7.tar.xz
wireguard-tools-cf7ec31d2d74458781d37d52fb4245def24123e7.zip
wg-quick: android: check for null in binder cleanup functions
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rw-r--r--src/wg-quick/android.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/wg-quick/android.c b/src/wg-quick/android.c
index fefbe38..144d462 100644
--- a/src/wg-quick/android.c
+++ b/src/wg-quick/android.c
@@ -358,15 +358,18 @@ static __attribute__((__constructor__(65535))) void load_symbols(void)
static void cleanup_binder(AIBinder **binder)
{
- AIBinder_decStrong(*binder);
+ if (*binder)
+ AIBinder_decStrong(*binder);
}
static void cleanup_status(AStatus **status)
{
- AStatus_delete(*status);
+ if (*status)
+ AStatus_delete(*status);
}
static void cleanup_parcel(AParcel **parcel)
{
- AParcel_delete(*parcel);
+ if (*parcel)
+ AParcel_delete(*parcel);
}
#define _cleanup_status_ __attribute__((__cleanup__(cleanup_status)))