Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / libjava / classpath / native / jni / java-net / java_net_VMInetAddress.c
index 6ee7773..4de63cf 100644 (file)
@@ -180,6 +180,7 @@ Java_java_net_VMInetAddress_getHostByAddr (JNIEnv * env,
 
   /* Resolve the address and return the name */
   result = cpnet_getHostByAddr (env, addr, hostname, sizeof (hostname));
+  cpnet_freeAddress (env, addr);
   if (result != CPNATIVE_OK)
     {
       JCL_ThrowException (env, UNKNOWN_HOST_EXCEPTION,
@@ -330,6 +331,7 @@ Java_java_net_VMInetAddress_aton (JNIEnv *env,
     }
 
   result = cpnet_aton (env, hostname, &address);
+  (*env)->ReleaseStringUTFChars (env, host, hostname);
   if (result != CPNATIVE_OK)
     {
       JCL_ThrowException (env, UNKNOWN_HOST_EXCEPTION, "Internal Error");