Missing error check issues fix 10/226510/1 accepted/tizen/unified/20200304.123914 submit/tizen/20200303.083225
authorsrinivasa.m <srinivasa.m@samsung.com>
Tue, 3 Mar 2020 07:29:29 +0000 (12:59 +0530)
committersrinivasa.m <srinivasa.m@samsung.com>
Tue, 3 Mar 2020 07:29:29 +0000 (12:59 +0530)
Change-Id: I647e9752277af8545ed0703536acc39b0e3e9a6c
Signed-off-by: srinivasa.m <srinivasa.m@samsung.com>
server/auth_discovery/src/BAuthStub.cpp

index 31c6875..38457e3 100644 (file)
@@ -449,12 +449,12 @@ BAuthStub::hash(const std::string& message)
                }
                hashInfo->len = SHA256_DIGEST_LENGTH;
                hashInfo->data = NALLOC(BIG_SIZE, uint8_t);
-               memcpy(hashInfo->data, digest, SHA256_DIGEST_LENGTH);
                if(hashInfo->data == NULL) {
                        _ERR("memory allocation failed");
                        SAFE_DELETE(hashInfo);
                        return NULL;
                }
+               memcpy(hashInfo->data, digest, SHA256_DIGEST_LENGTH);
                //std::string digestStr((char*)digest, 5000);
                _END;
                return hashInfo;