aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhejl <hejl@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-03-03 08:40:07 +0000
committerhejl <hejl@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-03-03 08:40:07 +0000
commit2f4f59ba2e28ee38f721f09ab6756fd4575b3f78 (patch)
treea74b17d24934207c8ea35765be1b19a538d724df
parentb9a217e0dc5906e07b9f1e4674e9b797b6dd9b46 (diff)
downloadlcd4linux-2f4f59ba2e28ee38f721f09ab6756fd4575b3f78.tar.gz
[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
-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;
}