# HG changeset patch # User chegar # Date 1517833771 0 # Node ID 34eabbaa1226bc405f6dfff2a48882c5ada2a145 # Parent f140c8326fd98bd8dd7db4e50d590b5c8760f608 http-client-branch: possible null dereference in Exchange diff -r f140c8326fd9 -r 34eabbaa1226 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;