This patch fixes a coverity issue [1].
Since 'ctx' is dereferenced in EVP_DigestInit_ex call, it should be NULL checked before calling this function.
[1] http://10.113.139.115:8081/reports.htm#v19039/p11006/fileInstanceId=
612233125&defectInstanceId=
130271535&mergedDefectId=1706287
Change-Id: I0e1e8a7a775734649ecffe9d5adaf0bd71dac8a5
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
EVP_MD_CTX *ctx = EVP_MD_CTX_create();
const EVP_MD *md = EVP_sha256();
+ if (!ctx) {
+ _E("Unable to get EVP_MD_CTX object");
+ return;
+ }
+
if (!EVP_DigestInit_ex(ctx, md, NULL)) {
_E("Unable to initialize hashing module");
goto out;