Fix incompatible memory deallocation issue 52/215152/2 submit/tizen/20191002.053001
authorJaehyun Kim <jeik01.kim@samsung.com>
Wed, 2 Oct 2019 05:18:44 +0000 (14:18 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Wed, 2 Oct 2019 05:20:53 +0000 (14:20 +0900)
Change-Id: Ibefe8fa4cfdf4d009e7b23ef1043d41fc6bae098
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
src/dns64.c

index 12fb2cb..5d0c804 100644 (file)
@@ -84,7 +84,16 @@ int plat_prefix(const char *ipv4_name, unsigned net_id, struct in6_addr *prefix)
        plat_addr = ((struct sockaddr_in6 *)result->ai_addr)->sin6_addr;
        // Only /96 DNS64 prefixes are supported at this time.
        plat_addr.s6_addr32[3] = 0;
+#if defined TIZEN_EXT
+       if (has_specific_nameserver()) {
+               free(result->ai_addr);
+               free(result);
+       } else {
+               freeaddrinfo(result);
+       }
+#else
        freeaddrinfo(result);
+#endif
 
        CLATD_LOG(LOG_INFO, "Detected NAT64 prefix %s/96",
                        inet_ntop(AF_INET6, &plat_addr, plat_addr_str, sizeof(plat_addr_str)));