Fixed svase-warnings for iotivity-product's SQA on |credresource|
authorKyungsun Cho <goodsun.cho@samsung.com>
Fri, 1 Jul 2016 04:49:55 +0000 (13:49 +0900)
committerRandeep Singh <randeep.s@samsung.com>
Fri, 1 Jul 2016 08:02:50 +0000 (08:02 +0000)
Change-Id: I48452b2b0e634d2d7b6cf7643ba9a27ede4877e5
Signed-off-by: Kyungsun Cho <goodsun.cho@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/9061
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
resource/csdk/security/src/credresource.c

index 00e8e16..1673b21 100644 (file)
@@ -1387,7 +1387,6 @@ int32_t GetDtlsPskCredentials(CADtlsPskCredType_t type,
                             if(IOTVTICAL_VALID_ACCESS != IsRequestWithinValidTime(cred->period, NULL))
                             {
                                 OIC_LOG (INFO, TAG, "Credentials are expired.");
-                                ret = -1;
                                 return ret;
                             }
                         }
@@ -1406,7 +1405,6 @@ int32_t GetDtlsPskCredentials(CADtlsPskCredType_t type,
                             uint32_t outKeySize;
                             if(NULL == outKey)
                             {
-                                result_length = -1;
                                 OIC_LOG (ERROR, TAG, "Failed to memoray allocation.");
                                 return ret;
                             }
@@ -1414,18 +1412,17 @@ int32_t GetDtlsPskCredentials(CADtlsPskCredType_t type,
                             if(B64_OK == b64Decode((char*)cred->privateData.data, cred->privateData.len, outKey, outBufSize, &outKeySize))
                             {
                                 memcpy(result, outKey, outKeySize);
-                                result_length = outKeySize;
+                                ret = outKeySize;
                             }
                             else
                             {
-                                result_length = -1;
                                 OIC_LOG (ERROR, TAG, "Failed to base64 decoding.");
                             }
 
                             OICFree(outKey);
                         }
 
-                        return result_length;
+                        return ret;
                     }
                 }
             }
@@ -1434,7 +1431,6 @@ int32_t GetDtlsPskCredentials(CADtlsPskCredType_t type,
         default:
             {
                 OIC_LOG (ERROR, TAG, "Wrong value passed for CADtlsPskCredType_t.");
-                ret = -1;
             }
             break;
     }