summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBertrand Jacquin <bjacquin@exosec.fr>2012-12-11 15:49:35 +0100
committerBertrand Jacquin <bjacquin@exosec.fr>2012-12-11 15:49:35 +0100
commit138d189fb2be550fe56787026960e19e8d802754 (patch)
treea06ab281a59b4fd7c6ffac8f872f58caf5c34fdd
parent[CLEANUP] Eliminate the usage of malloc() in vv_set (diff)
downloadmod_virtualvalue-138d189fb2be550fe56787026960e19e8d802754.tar.gz
[CLEANUP] Eliminate the usage of malloc() in vv_var_new, so TODO-- as in
whole project.
-rw-r--r--TODO1
-rw-r--r--mod_virtualvalue.c6
2 files changed, 3 insertions, 4 deletions
diff --git a/TODO b/TODO
index 9419573..68fafa2 100644
--- a/TODO
+++ b/TODO
@@ -27,5 +27,4 @@
- Log with ap_ funcs
- ap_log_cerror
- - Use memory pool
- Use more of apr API
diff --git a/mod_virtualvalue.c b/mod_virtualvalue.c
index f2aa9d6..881f67b 100644
--- a/mod_virtualvalue.c
+++ b/mod_virtualvalue.c
@@ -57,10 +57,10 @@ typedef struct {
/*
* Create new configuration element
*/
-static virtualvalue_var_t *vv_var_new (void) {
+static virtualvalue_var_t *vv_var_new(apr_pool_t *pool) {
virtualvalue_var_t *elm;
- elm = (virtualvalue_var_t *)malloc(sizeof(virtualvalue_var_t));
+ elm = (virtualvalue_var_t *)apr_palloc(pool, sizeof(virtualvalue_var_t));
if (!elm)
return NULL;
@@ -279,7 +279,7 @@ static const char *vv_set (cmd_parms *cmd, void *struct_ptr __U__, int argc, cha
if (!argc || !argv[0])
return NULL;
- n = vv_var_new ();
+ n = vv_var_new(cmd->pool);
if (!n)
return NULL;