From: Christophe Jaillet Date: Mon, 9 Dec 2013 21:11:09 +0000 (+0000) Subject: Use apr_pstrmemdup instead of apr_pstrndup when this is safe. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f488fb20ce4a0994f0d3128769992429abd8a69e;p=thirdparty%2Fapache%2Fhttpd.git Use apr_pstrmemdup instead of apr_pstrndup when this is safe. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1549680 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/cache/mod_cache_disk.c b/modules/cache/mod_cache_disk.c index 83bbc01d3b1..ddf6431440c 100644 --- a/modules/cache/mod_cache_disk.c +++ b/modules/cache/mod_cache_disk.c @@ -381,7 +381,7 @@ static int create_entity(cache_handle_t *h, request_rec *r, const char *key, apr dobj->name = obj->key; dobj->prefix = NULL; /* Save the cache root */ - dobj->root = apr_pstrndup(r->pool, conf->cache_root, conf->cache_root_len); + dobj->root = apr_pstrmemdup(r->pool, conf->cache_root, conf->cache_root_len); dobj->root_len = conf->cache_root_len; apr_pool_create(&pool, r->pool); @@ -441,7 +441,7 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key) dobj->prefix = NULL; /* Save the cache root */ - dobj->root = apr_pstrndup(r->pool, conf->cache_root, conf->cache_root_len); + dobj->root = apr_pstrmemdup(r->pool, conf->cache_root, conf->cache_root_len); dobj->root_len = conf->cache_root_len; dobj->vary.file = header_file(r->pool, conf, dobj, key);