[svn:mod_parrot] r634 - mod_parrot/trunk/src

[email protected] Mon, 27 Apr 2009 14:29:41 -0700 (PDT)
Newsgroups perl.cvs.mod_parrot
Message-ID <[email protected]>
Author: jhorwitz
Date: Mon Apr 27 14:29:41 2009
New Revision: 634

Modified:
   mod_parrot/trunk/src/context.c

Log:
allocate string for ctx_pool_hash key instead of using the raw argument


Modified: mod_parrot/trunk/src/context.c
==============================================================================
--- mod_parrot/trunk/src/context.c	(original)
+++ mod_parrot/trunk/src/context.c	Mon Apr 27 14:29:41 2009
@@ -24,6 +24,7 @@
 #include "http_connection.h"
 #include "http_main.h"
 #include "mpm.h"
+#include "apr_strings.h"
 #include "apr_thread_mutex.h"
 
 #include "parrot/parrot.h"
@@ -247,7 +248,8 @@
 void modparrot_set_named_ctx_pool(apr_pool_t *p, const char *name,
     apr_array_header_t *cp)
 {
-    apr_hash_set(mp_globals.ctx_pool_hash, name, APR_HASH_KEY_STRING, cp);
+    apr_hash_set(mp_globals.ctx_pool_hash, apr_pstrdup(p, name),
+        APR_HASH_KEY_STRING, cp);
     /* we always have 1 valid context, so use it to store the pool name */
     APR_ARRAY_IDX(cp, 0, modparrot_context *)->ctx_pool_name =
         (const char *)apr_pstrdup(p, name);