From 2f4f59ba2e28ee38f721f09ab6756fd4575b3f78 Mon Sep 17 00:00:00 2001 From: hejl Date: Wed, 3 Mar 2004 08:40:07 +0000 Subject: [lcd4linux @ 2004-03-03 08:40:07 by hejl] Fixed memory leak in hash_get_regex git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@386 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- hash.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hash.c b/hash.c index 72e522a..d71971b 100644 --- a/hash.c +++ b/hash.c @@ -1,4 +1,4 @@ -/* $Id: hash.c,v 1.15 2004/03/03 04:44:16 reinelt Exp $ +/* $Id: hash.c,v 1.16 2004/03/03 08:40:07 hejl Exp $ * * hashes (associative arrays) * @@ -23,6 +23,9 @@ * * * $Log: hash.c,v $ + * Revision 1.16 2004/03/03 08:40:07 hejl + * Fixed memory leak in hash_get_regex + * * Revision 1.15 2004/03/03 04:44:16 reinelt * changes (cosmetics?) to the big patch from Martin * hash patch un-applied @@ -352,6 +355,7 @@ double hash_get_regex (HASH *Hash, char *key, int delay) char buffer[32]; regerror(err, &preg, buffer, sizeof(buffer)); error ("error in regular expression: %s", buffer); + regfree(&preg); return 0.0; } @@ -363,6 +367,7 @@ double hash_get_regex (HASH *Hash, char *key, int delay) sum+=hash_get_delta(Hash, Hash->Items[i].key, delay); } } + regfree(&preg); return sum; } -- cgit v1.2.3