Skip to content

Commit

Permalink
Avoid a nil-reference when the temporary file cannot be created
Browse files Browse the repository at this point in the history
  • Loading branch information
ankon committed Mar 14, 2017
1 parent c67e106 commit 3dece0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/pkg/net/ssl/ssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ func AddOrUpdateCertAndKey(name string, cert, key, ca []byte) (*ingress.SSLCert,

tempPemFile, err := ioutil.TempFile(ingress.DefaultSSLDirectory, pemName)

glog.V(3).Infof("Creating temp file %v for Keypair: %v", tempPemFile.Name(), pemName)
if err != nil {
return nil, fmt.Errorf("could not create temp pem file %v: %v", pemFileName, err)
}
glog.V(3).Infof("Creating temp file %v for Keypair: %v", tempPemFile.Name(), pemName)

_, err = tempPemFile.Write(cert)
if err != nil {
Expand Down

0 comments on commit 3dece0a

Please sign in to comment.