proxy: Fix a potential panic handling error states.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh) Upstream-commit: ad5b307d0fb00ff0a63b3f97e529fa67bfce50b3 Component: engine
This commit is contained in:
@ -130,7 +130,12 @@ func (p *proxyCommand) Start() error {
|
||||
r.Read(buf)
|
||||
|
||||
if string(buf) != "0\n" {
|
||||
errStr, _ := ioutil.ReadAll(r)
|
||||
errStr, err := ioutil.ReadAll(r)
|
||||
if err != nil {
|
||||
errchan <- fmt.Errorf("Error reading exit status from userland proxy: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
errchan <- fmt.Errorf("Error starting userland proxy: %s", errStr)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user