From bf2ca6f3685e469bd4e0e3aa499464cbcfd94ea9 Mon Sep 17 00:00:00 2001 From: erg Date: Wed, 20 Jun 2007 18:49:13 +0000 Subject: [PATCH] Fix memory leak in pointset. --- lib/common/pointset.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/common/pointset.c b/lib/common/pointset.c index 3c098d3f1..a28236395 100644 --- a/lib/common/pointset.c +++ b/lib/common/pointset.c @@ -31,6 +31,11 @@ static pair *mkPair(point p) return pp; } +static void freePair(Dt_t * d, pair* pp, Dtdisc_t * disc) +{ + free (pp); +} + static int cmppair(Dt_t * d, point * key1, point * key2, Dtdisc_t * disc) { if (key1->x > key2->x) @@ -50,7 +55,7 @@ static Dtdisc_t intPairDisc = { sizeof(point), offsetof(pair, link), 0, - 0, + (Dtfree_f) freePair, (Dtcompar_f) cmppair, 0, 0, -- 2.40.0