]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/bio/bf_buff.c
free null cleanup finale
[thirdparty/openssl.git] / crypto / bio / bf_buff.c
index d82385a06c2e298052b5d5d12b6a6a1cc36334e1..53a120465a712da67290b76784038ac08287df78 100644 (file)
@@ -127,10 +127,8 @@ static int buffer_free(BIO *a)
     if (a == NULL)
         return (0);
     b = (BIO_F_BUFFER_CTX *)a->ptr;
-    if (b->ibuf != NULL)
-        OPENSSL_free(b->ibuf);
-    if (b->obuf != NULL)
-        OPENSSL_free(b->obuf);
+    OPENSSL_free(b->ibuf);
+    OPENSSL_free(b->obuf);
     OPENSSL_free(a->ptr);
     a->ptr = NULL;
     a->init = 0;
@@ -339,8 +337,7 @@ static long buffer_ctrl(BIO *b, int cmd, long num, void *ptr)
             p1 = OPENSSL_malloc((int)num);
             if (p1 == NULL)
                 goto malloc_error;
-            if (ctx->ibuf != NULL)
-                OPENSSL_free(ctx->ibuf);
+            OPENSSL_free(ctx->ibuf);
             ctx->ibuf = p1;
         }
         ctx->ibuf_off = 0;