fix various formatting nits in CMP contribution chunks 1-6 found by the new util...
[openssl.git] / apps / pkcs12.c
index 5eff88b64476e984327d1db92875396b863f3bcf..091318b67d8da8a7b2ab2e799045141380547209 100644 (file)
@@ -893,12 +893,13 @@ static int alg_print(const X509_ALGOR *alg)
 
 int cert_load(BIO *in, STACK_OF(X509) *sk)
 {
-    int ret;
+    int ret = 0;
     X509 *cert;
-    ret = 0;
+
     while ((cert = PEM_read_bio_X509(in, NULL, NULL, NULL))) {
         ret = 1;
-        sk_X509_push(sk, cert);
+        if (!sk_X509_push(sk, cert))
+            return 0;
     }
     if (ret)
         ERR_clear_error();