File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
dd-java-agent/src/main/java/datadog/trace/bootstrap Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 11package datadog .trace .bootstrap ;
22
33import java .io .IOException ;
4+ import java .io .OutputStream ;
45import java .util .concurrent .TimeUnit ;
56
67/** Thread safe telemetry class used to relay information about tracer activation. */
@@ -204,8 +205,10 @@ public void send(JsonBuffer buffer) throws IOException {
204205 ProcessBuilder builder = new ProcessBuilder (forwarderPath );
205206
206207 Process process = builder .start ();
207- process .getOutputStream ().write (buffer .toByteArray ());
208-
208+ try ( OutputStream out = process .getOutputStream () ) {
209+ out .write (buffer .toByteArray ());
210+ }
211+
209212 try {
210213 process .waitFor (1 , TimeUnit .SECONDS );
211214 } catch (InterruptedException e ) {
You can’t perform that action at this time.
0 commit comments