diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-10-16 14:23:27 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-10-16 14:23:27 +0200 |
commit | 0b27b1d315e9d1e6edd0c5eadbd2010abd1746cd (patch) | |
tree | c4b9e95d2ae93fbbc6c83e287b4f5c82a7c5fef3 /src/tools/wg-quick | |
parent | version: bump snapshot (diff) | |
download | wireguard-monolithic-historical-0b27b1d315e9d1e6edd0c5eadbd2010abd1746cd.tar.xz wireguard-monolithic-historical-0b27b1d315e9d1e6edd0c5eadbd2010abd1746cd.zip |
wg-quick: android: check for null in binder cleanup functions
Diffstat (limited to 'src/tools/wg-quick')
-rw-r--r-- | src/tools/wg-quick/android.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/tools/wg-quick/android.c b/src/tools/wg-quick/android.c index fefbe38..144d462 100644 --- a/src/tools/wg-quick/android.c +++ b/src/tools/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))) |