Skip to content

Commit

Permalink
Merge pull request #439 from Collaborne/pr/nil-reference-temp-file
Browse files Browse the repository at this point in the history
Avoid a nil-reference when the temporary file cannot be created
  • Loading branch information
aledbf authored Mar 14, 2017
2 parents 7b79c66 + 3dece0a commit 153fdf5
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 153fdf5

Please sign in to comment.