8033689: PlainDatagramSocketImpl missing returns after throwing an exception
authorchegar
Wed, 05 Feb 2014 14:14:46 +0000
changeset 22651 bfc6ca5245fd
parent 22650 4d27550a5a27
child 22652 141565f2aafc
8033689: PlainDatagramSocketImpl missing returns after throwing an exception Reviewed-by: michaelm
jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c
--- a/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Wed Feb 05 14:21:10 2014 +0100
+++ b/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Wed Feb 05 14:14:46 2014 +0000
@@ -506,6 +506,7 @@
     }
     if (IS_NULL(addressObj)) {
         JNU_ThrowNullPointerException(env, "Null address in peek()");
+        return -1;
     }
     if (timeout) {
         int ret = NET_Timeout(fd, timeout);
@@ -1419,7 +1420,7 @@
         default :
             JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
                 "Socket option not supported by PlainDatagramSocketImp");
-            break;
+            return;
 
     }
 
@@ -1833,6 +1834,7 @@
 #ifdef AF_INET6
 #ifdef __linux__
     setTTL(env, fd, ttl);
+    JNU_CHECK_EXCEPTION(env);
     if (ipv6_available()) {
         setHopLimit(env, fd, ttl);
     }
@@ -2120,6 +2122,7 @@
                     else
                         NET_ThrowCurrent(env, "setsockopt IP_DROP_MEMBERSHIP failed");
                 }
+                return;
             }
         }