]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
android: Properly deinit library if parsing an IP fails
authorTobias Brunner <tobias@strongswan.org>
Tue, 4 Feb 2025 13:07:37 +0000 (14:07 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 18 Feb 2025 13:12:43 +0000 (14:12 +0100)
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.

src/frontends/android/app/src/main/jni/libandroidbridge/charonservice.c

index 89868a710f91b31fcf398f53970cbf1a98369766..12ac0172781b21941c03c42800836a0ac0e9d0cb 100644 (file)
@@ -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;
        }