free NULL cleanup 5a
[openssl.git] / apps / apps.c
index a93151c831540323b14cbc5e778c8c638f961ef7..9475fe3ccd8113c7bad39cb061069825e1ba84d2 100644 (file)
@@ -971,8 +971,7 @@ static int load_certs_crls(const char *file, int format,
 
  end:
 
-    if (xis)
-        sk_X509_INFO_pop_free(xis, X509_INFO_free);
+    sk_X509_INFO_pop_free(xis, X509_INFO_free);
 
     if (rv == 0) {
         if (pcerts) {
@@ -1414,8 +1413,7 @@ BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai)
     }
  err:
     BIO_free(in);
-    if (ai != NULL)
-        ASN1_INTEGER_free(ai);
+    ASN1_INTEGER_free(ai);
     return (ret);
 }
 
@@ -1468,8 +1466,7 @@ int save_serial(char *serialfile, char *suffix, BIGNUM *serial,
     }
  err:
     BIO_free_all(out);
-    if (ai != NULL)
-        ASN1_INTEGER_free(ai);
+    ASN1_INTEGER_free(ai);
     return (ret);
 }
 
@@ -1837,7 +1834,7 @@ X509_NAME *parse_name(const char *cp, long chtype, int canmulti)
     n = X509_NAME_new();
     if (n == NULL)
         return NULL;
-    work = strdup(cp);
+    work = OPENSSL_strdup(cp);
     if (work == NULL)
         goto err;
 
@@ -1894,12 +1891,12 @@ X509_NAME *parse_name(const char *cp, long chtype, int canmulti)
             goto err;
     }
 
-    free(work);
+    OPENSSL_free(work);
     return n;
 
  err:
     X509_NAME_free(n);
-    free(work);
+    OPENSSL_free(work);
     return NULL;
 }