]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openssl: fix a potential memory leak of bio_out
authorx2018 <xkernel.wang@foxmail.com>
Mon, 17 Nov 2025 06:26:24 +0000 (14:26 +0800)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 17 Nov 2025 13:44:34 +0000 (14:44 +0100)
Closes #19561

lib/vtls/openssl.c

index 9b3ca9b5eaecc264e476200d2f22bb86e11c44d2..fd6396471c9209155034d61c53bc624229e8e9c0 100644 (file)
@@ -1625,8 +1625,8 @@ static CURLcode x509_name_oneline(X509_NAME *a, struct dynbuf *d)
     if(rc != -1) {
       BIO_get_mem_ptr(bio_out, &biomem);
       result = curlx_dyn_addn(d, biomem->data, biomem->length);
-      BIO_free(bio_out);
     }
+    BIO_free(bio_out);
   }
   return result;
 }