[WGID-253397, 253398] Fix unreachable code 86/148786/1 submit/tizen/20170911.125730
authorchleun.moon <chleun.moon@samsung.com>
Mon, 11 Sep 2017 01:15:47 +0000 (10:15 +0900)
committerchleun.moon <chleun.moon@samsung.com>
Mon, 11 Sep 2017 01:16:49 +0000 (10:16 +0900)
Change-Id: Ie3faef9d95d95cbcfbd222d92f25e6eae8e41581
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
vpn/plugins/ipsec.c

index 6862fbccc0fbb0e058bd8b5182f3ee618ab5ed57..7a2675e02cdc6d2a46ddf5be594a0fd1a1262cfa 100644 (file)
@@ -267,7 +267,7 @@ static int read_der_file(const char *path, X509 **cert)
        }
 
        *cert = d2i_X509_fp(fp, NULL);
-       if (!fp) {
+       if (!(*cert)) {
                connman_error("Failed to read der file");
                err = -EINVAL;
        }
@@ -295,7 +295,7 @@ static int read_pem_file(const char *path, X509 **cert)
        }
 
        *cert = PEM_read_X509(fp, cert, NULL, NULL);
-       if (!fp) {
+       if (!(*cert)) {
                connman_error("Failed to read pem file");
                err = -EINVAL;
        }