shithub: git9

Download patch

ref: 724c516a6eda0063439457a6701ef0d7ef37eb93
parent: a18673d25a46c235289eb9b5748af1eb4ecd7170
author: Ori Bernstein <[email protected]>
date: Sat Mar 20 10:21:18 EDT 2021

pack: Fix memory leak in readmeta (thanks Stefan Sperling)

In this code path, *m is always nil -- v.meta is the
value that got allocated.

--- a/pack.c
+++ b/pack.c
@@ -1401,7 +1401,7 @@
 	return v.nmeta;
 out:
 	osclear(&has);
-	free(*m);
+	free(v.meta);
 	return -1;
 }