int len2; \
BIO *bio = BIO_new(BIO_s_null()); \
\
- PRINT(bio, type); \
- BIO_free(bio); \
+ if (bio != NULL) { \
+ PRINT(bio, type); \
+ BIO_free(bio); \
+ } \
len2 = I2D(type, &der); \
if (len2 != 0) {} \
OPENSSL_free(der); \
if (type != NULL) { \
BIO *bio = BIO_new(BIO_s_null()); \
\
- PRINT(bio, type, 0); \
- BIO_free(bio); \
+ if (bio != NULL) { \
+ PRINT(bio, type, 0); \
+ BIO_free(bio); \
+ } \
I2D(type, &der); \
OPENSSL_free(der); \
TYPE ## _free(type); \
if (type != NULL) { \
BIO *bio = BIO_new(BIO_s_null()); \
\
- PRINT(bio, type, 0, pctx); \
- BIO_free(bio); \
+ if (bio != NULL) { \
+ PRINT(bio, type, 0, pctx); \
+ BIO_free(bio); \
+ } \
I2D(type, &der); \
OPENSSL_free(der); \
TYPE ## _free(type); \
if (o != NULL) {
BIO *bio = BIO_new(BIO_s_null());
-
- ASN1_item_print(bio, o, 4, i, pctx);
- BIO_free(bio);
+ if (bio != NULL) {
+ ASN1_item_print(bio, o, 4, i, pctx);
+ BIO_free(bio);
+ }
ASN1_item_i2d(o, &der, i);
OPENSSL_free(der);
ASN1_item_free(o, i);