546bf9
diff -up openssl-1.0.1e/crypto/cms/cms_smime.c.unknown-hash openssl-1.0.1e/crypto/cms/cms_smime.c
546bf9
--- openssl-1.0.1e/crypto/cms/cms_smime.c.unknown-hash	2013-02-11 16:26:04.000000000 +0100
546bf9
+++ openssl-1.0.1e/crypto/cms/cms_smime.c	2015-06-09 16:07:16.001516190 +0200
546bf9
@@ -141,7 +141,7 @@ static void do_free_upto(BIO *f, BIO *up
546bf9
 			BIO_free(f);
546bf9
 			f = tbio;
546bf9
 			}
546bf9
-		while (f != upto);
546bf9
+		while (f && f != upto);
546bf9
 		}
546bf9
 	else
546bf9
 		BIO_free_all(f);