07ea28
Index: modules/aaa/mod_authz_dbd.c
07ea28
===================================================================
07ea28
--- a/modules/aaa/mod_authz_dbd.c	(revision 1681106)
07ea28
+++ b/modules/aaa/mod_authz_dbd.c	(revision 1681107)
07ea28
@@ -174,7 +174,9 @@
07ea28
                           action, r->user, message?message:noerror);
07ea28
                 }
07ea28
                 else if (newuri == NULL) {
07ea28
-                    newuri = apr_dbd_get_entry(dbd->driver, row, 0);
07ea28
+                    newuri =
07ea28
+                        apr_pstrdup(r->pool,
07ea28
+                                    apr_dbd_get_entry(dbd->driver, row, 0));
07ea28
                 }
07ea28
                 /* we can't break out here or row won't get cleaned up */
07ea28
             }
07ea28
@@ -204,7 +206,6 @@
07ea28
     apr_dbd_prepared_t *query;
07ea28
     apr_dbd_results_t *res = NULL;
07ea28
     apr_dbd_row_t *row = NULL;
07ea28
-    const char **group;
07ea28
 
07ea28
     if (cfg->query == NULL) {
07ea28
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01649)
07ea28
@@ -224,8 +225,9 @@
07ea28
              rv != -1;
07ea28
              rv = apr_dbd_get_row(dbd->driver, r->pool, res, &row, -1)) {
07ea28
             if (rv == 0) {
07ea28
-                group = apr_array_push(groups);
07ea28
-                *group = apr_dbd_get_entry(dbd->driver, row, 0);
07ea28
+                APR_ARRAY_PUSH(groups, const char *) =
07ea28
+                    apr_pstrdup(r->pool,
07ea28
+                                apr_dbd_get_entry(dbd->driver, row, 0));
07ea28
             }
07ea28
             else {
07ea28
                 message = apr_dbd_error(dbd->driver, dbd->handle, rv);
07ea28
Index: modules/session/mod_session_dbd.c
07ea28
===================================================================
07ea28
--- a/modules/session/mod_session_dbd.c	(revision 1681106)
07ea28
+++ b/modules/session/mod_session_dbd.c	(revision 1681107)
07ea28
@@ -138,7 +138,8 @@
07ea28
             return APR_EGENERAL;
07ea28
         }
07ea28
         if (*val == NULL) {
07ea28
-            *val = apr_dbd_get_entry(dbd->driver, row, 0);
07ea28
+            *val = apr_pstrdup(r->pool,
07ea28
+                               apr_dbd_get_entry(dbd->driver, row, 0));
07ea28
         }
07ea28
         /* we can't break out here or row won't get cleaned up */
07ea28
     }
07ea28
Index: modules/mappers/mod_rewrite.c
07ea28
===================================================================
07ea28
--- a/modules/mappers/mod_rewrite.c	(revision 1681106)
07ea28
+++ b/modules/mappers/mod_rewrite.c	(revision 1681107)
07ea28
@@ -1352,12 +1352,14 @@
07ea28
     while ((rv = apr_dbd_get_row(db->driver, r->pool, res, &row, -1)) == 0) {
07ea28
         ++n;
07ea28
         if (ret == NULL) {
07ea28
-            ret = apr_dbd_get_entry(db->driver, row, 0);
07ea28
+            ret = apr_pstrdup(r->pool,
07ea28
+                              apr_dbd_get_entry(db->driver, row, 0));
07ea28
         }
07ea28
         else {
07ea28
             /* randomise crudely amongst multiple results */
07ea28
             if ((double)rand() < (double)RAND_MAX/(double)n) {
07ea28
-                ret = apr_dbd_get_entry(db->driver, row, 0);
07ea28
+                ret = apr_pstrdup(r->pool,
07ea28
+                                  apr_dbd_get_entry(db->driver, row, 0));
07ea28
             }
07ea28
         }
07ea28
     }
07ea28
@@ -1370,11 +1372,11 @@
07ea28
     case 0:
07ea28
         return NULL;
07ea28
     case 1:
07ea28
-        return apr_pstrdup(r->pool, ret);
07ea28
+        return ret;
07ea28
     default:
07ea28
         /* what's a fair rewritelog level for this? */
07ea28
         rewritelog((r, 3, NULL, "Multiple values found for %s", key));
07ea28
-        return apr_pstrdup(r->pool, ret);
07ea28
+        return ret;
07ea28
     }
07ea28
 }
07ea28