shithub: sl

Download patch

ref: a62ff99e463e574da861e103eb90768658448086
parent: 9b064b44312f1125bd4af59f9c27df69834ddc2f
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Sun Jan 5 22:47:41 EST 2025

libmp: tests: don't leak

--- a/3rd/mp/test/ld.c
+++ b/3rd/mp/test/ld.c
@@ -538,12 +538,15 @@
 {
 	uint32_t j, state;
 	uint32_t r = 0;
+	ldint *b;
 
 	if(i < 257)
 		itold(i-128, a);
-	else if(i < 514)
-		pow2told(i-385, a);
-	else{
+	else if(i < 514){
+		b = pow2told(i-385, a);
+		if(a == nil)
+			ldfree(b);
+	}else{
 		state = i;
 		xorshift(&state);
 		xorshift(&state);