From 09b86c46b82e3d116840f3327a1f995b904ecfa4 Mon Sep 17 00:00:00 2001 From: John Howard Date: Wed, 22 Jul 2015 16:01:32 -0700 Subject: [PATCH] Stop SIGSEGV on test dial not reachable Signed-off-by: John Howard --- integration-cli/docker_utils.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/integration-cli/docker_utils.go b/integration-cli/docker_utils.go index 5f5729d4fd81f..b3e4e92584372 100644 --- a/integration-cli/docker_utils.go +++ b/integration-cli/docker_utils.go @@ -338,11 +338,9 @@ func sockRequest(method, endpoint string, data interface{}) (int, []byte, error) res, body, err := sockRequestRaw(method, endpoint, jsonData, "application/json") if err != nil { - b, _ := ioutil.ReadAll(body) - return -1, b, err + return -1, nil, err } - var b []byte - b, err = readBody(body) + b, err := readBody(body) return res.StatusCode, b, err }