aboutsummaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorhejl <>2004-03-03 08:40:07 +0000
committerhejl <>2004-03-03 08:40:07 +0000
commitf2539b94c0c65abd21168a509a27228696b7f4ee (patch)
treea74b17d24934207c8ea35765be1b19a538d724df /hash.c
parent9343d98c97ce8130374cd1c6b702c336e1ae0666 (diff)
downloadlcd4linux-f2539b94c0c65abd21168a509a27228696b7f4ee.tar.gz
[lcd4linux @ 2004-03-03 08:40:07 by hejl]
Fixed memory leak in hash_get_regex
Diffstat (limited to '')
-rw-r--r--hash.c7
1 files changed, 6 insertions, 1 deletions
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;
}