Browse code

Stop SIGSEGV on test dial not reachable

Signed-off-by: John Howard <jhoward@microsoft.com>

John Howard authored on 2015/07/23 08:01:32
Showing 1 changed files
... ...
@@ -338,11 +338,9 @@ func sockRequest(method, endpoint string, data interface{}) (int, []byte, error)
338 338
 
339 339
 	res, body, err := sockRequestRaw(method, endpoint, jsonData, "application/json")
340 340
 	if err != nil {
341
-		b, _ := ioutil.ReadAll(body)
342
-		return -1, b, err
341
+		return -1, nil, err
343 342
 	}
344
-	var b []byte
345
-	b, err = readBody(body)
343
+	b, err := readBody(body)
346 344
 	return res.StatusCode, b, err
347 345
 }
348 346