Fixing the usage of pointer in config 67/32967/2
authorKiran Kamineni <kiran.k.kamineni@intel.com>
Mon, 26 Feb 2018 23:48:11 +0000 (15:48 -0800)
committerKiran Kamineni <kiran.k.kamineni@intel.com>
Tue, 27 Feb 2018 17:49:05 +0000 (17:49 +0000)
Initializing the pointer before using it in JSON
decode. This was not erroring out before, but this
is the right usage.

Issue-ID: AAF-145
Change-Id: I9a4f8adbe946e896112a8fbef2a84b790578f780
Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
sms-service/src/sms/config/config.go
sms-service/src/sms/smsconfig.json

index b7f97d2..15f3660 100644 (file)
@@ -44,8 +44,9 @@ func ReadConfigFile(file string) (*SMSConfiguration, error) {
                        return nil, err
                }
 
+               SMSConfig = &SMSConfiguration{}
                decoder := json.NewDecoder(f)
-               err = decoder.Decode(&SMSConfig)
+               err = decoder.Decode(SMSConfig)
                if err != nil {
                        return nil, err
                }
index b683bf8..e8e8245 100644 (file)
@@ -1,6 +1,6 @@
 {
     "cafile":     "auth/selfsignedca.pem",
-    "servercert": "auth/server_cat.cert",
+    "servercert": "auth/server.cert",
     "serverkey":  "auth/server.key",
 
     "vaultaddress":     "http://localhost:8200",