shithub: riscv

Download patch

ref: 117f177ccf688b7aea8b57133b442a93840fafd5
parent: ad7316e87cd0444908caa74a5dfd4cf6168c5472
author: cinap_lenrek <[email protected]>
date: Sat Dec 1 22:23:48 EST 2018

libsec: fix memory leak in pkcs1_decrypt()

--- a/sys/src/libsec/port/tlshand.c
+++ b/sys/src/libsec/port/tlshand.c
@@ -2832,6 +2832,7 @@
 	if(y == nil)
 		return nil;
 	data = mptobytes(y, (mpsignif(y)+7)/8);
+	mpfree(y);
 	if((data->len = pkcs1unpadbuf(data->data, data->len, sec->rsapub->n, 2)) < 0){
 		freebytes(data);
 		return nil;