From 87610799f2911a7e3515fdc1280da6a64c96b004 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Tue, 4 Feb 2025 14:07:37 +0100 Subject: [PATCH] android: Properly deinit library if parsing an IP fails This can happen with empty strings, which might be set for managed profiles, which caused the refcounting to be askew and the resolver not to work after connecting once because it was flushed and disabled. --- .../android/app/src/main/jni/libandroidbridge/charonservice.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/frontends/android/app/src/main/jni/libandroidbridge/charonservice.c b/src/frontends/android/app/src/main/jni/libandroidbridge/charonservice.c index 89868a710..12ac01727 100644 --- a/src/frontends/android/app/src/main/jni/libandroidbridge/charonservice.c +++ b/src/frontends/android/app/src/main/jni/libandroidbridge/charonservice.c @@ -820,6 +820,7 @@ JNI_METHOD_P(org_strongswan_android_utils, Utils, parseInetAddressBytes, jbyteAr host = host_create_from_string(str, 0); if (!host) { + library_deinit(); free(str); return NULL; }