Allow NULL for some _free routines.
[openssl.git] / crypto / buffer / buffer.c
index dfa5c23..48618a4 100644 (file)
@@ -42,6 +42,8 @@ BUF_MEM *BUF_MEM_new(void)
 
 void BUF_MEM_free(BUF_MEM *a)
 {
+    if (a == NULL)
+        return;
     if (a->data != NULL) {
         if (a->flags & BUF_MEM_FLAG_SECURE)
             OPENSSL_secure_clear_free(a->data, a->max);