http-client-branch: possible null dereference in Exchange http-client-branch
authorchegar
Mon, 05 Feb 2018 12:29:31 +0000
branchhttp-client-branch
changeset 56068 34eabbaa1226
parent 56066 f140c8326fd9
child 56069 ffaea9a1eed5
http-client-branch: possible null dereference in Exchange
src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Exchange.java
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Exchange.java	Mon Feb 05 11:59:39 2018 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Exchange.java	Mon Feb 05 12:29:31 2018 +0000
@@ -439,12 +439,15 @@
                                 // s can be null if an exception occurred
                                 // asynchronously while sending the preface.
                                 Throwable t = c.getRecordedCause();
+                                IOException ioe;
                                 if (t != null) {
                                     if (!cached)
                                         c.close();
-                                    return MinimalFuture.failedFuture(
-                                            new IOException("Can't get stream 1: " + t, t));
+                                    ioe = new IOException("Can't get stream 1: " + t, t);
+                                } else {
+                                    ioe = new IOException("Can't get stream 1");
                                 }
+                                return MinimalFuture.failedFuture(ioe);
                             }
                             exchImpl.released();
                             Throwable t;