Fix Coverity defects 02/175102/2 accepted/tizen/unified/20180416.213738 submit/tizen/20180413.092019 submit/tizen/20180415.233519
authorDongsun Lee <ds73.lee@samsung.com>
Mon, 9 Apr 2018 00:56:54 +0000 (09:56 +0900)
committerDongsun Lee <ds73.lee@samsung.com>
Thu, 12 Apr 2018 23:49:30 +0000 (08:49 +0900)
- 105718: Unchecked return value

Change-Id: Id44b5382efac170ead4db403397262e59a2daa12
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
src/vcore/api.cpp

index 58fc882..7ecdb2a 100644 (file)
@@ -791,7 +791,11 @@ err:
                }
 
                X509_STORE_CTX context;
-               X509_STORE_CTX_init(&context, store, cert, ustore);
+               if(!X509_STORE_CTX_init(&context, store, cert, ustore)) {
+                       X509_STORE_free(store);
+                       sk_X509_free(ustore);
+                       return CERTSVC_FAIL;
+               }
                int result = X509_verify_cert(&context);
 
                if (result == 1 && checkCaFlag) { // check strictly