From: Tobias Brunner Date: Tue, 4 Feb 2025 13:07:37 +0000 (+0100) Subject: android: Properly deinit library if parsing an IP fails X-Git-Tag: android-2.5.3^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87610799f2911a7e3515fdc1280da6a64c96b004;p=thirdparty%2Fstrongswan.git 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. --- 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 89868a710f..12ac017278 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; }