cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ro...@apache.org
Subject [cloudstack-cloudmonkey] branch master updated: network: fix segfault
Date Fri, 30 Nov 2018 19:36:48 GMT
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git


The following commit(s) were added to refs/heads/master by this push:
     new a8beed7  network: fix segfault
a8beed7 is described below

commit a8beed7912f78a0a211d45c74a40abb0fa045b12
Author: Rohit Yadav <rohit@apache.org>
AuthorDate: Sat Dec 1 01:05:57 2018 +0530

    network: fix segfault
    
    Fixes segfault issue when response is invalid (nil).
    
    Signed-off-by: Rohit Yadav <rohit@apache.org>
---
 cmd/network.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/network.go b/cmd/network.go
index b594565..e02c11b 100644
--- a/cmd/network.go
+++ b/cmd/network.go
@@ -66,12 +66,12 @@ func Login(r *Request) (string, error) {
 	spinner := r.Config.StartSpinner("trying to log in...")
 	resp, err := r.Client().PostForm(msURL.String(), params)
 	r.Config.StopSpinner(spinner)
-	config.Debug("Login POST response status code:", resp.StatusCode)
 
 	if err != nil {
 		return "", errors.New("failed to authenticate with the CloudStack server, please check
the settings: " + err.Error())
 	}
 
+	config.Debug("Login POST response status code:", resp.StatusCode)
 	if resp.StatusCode != http.StatusOK {
 		e := errors.New("failed to authenticate, please check the credentials")
 		if err != nil {


Mime
View raw message