]> granicus.if.org Git - apache/commitdiff
Use apr_pstrmemdup instead of apr_pstrndup when this is safe.
authorChristophe Jaillet <jailletc36@apache.org>
Mon, 9 Dec 2013 20:52:26 +0000 (20:52 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Mon, 9 Dec 2013 20:52:26 +0000 (20:52 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1549676 13f79535-47bb-0310-9956-ffa450edef68

modules/cluster/mod_heartmonitor.c
modules/proxy/balancers/mod_lbmethod_heartbeat.c

index 8e4231dc37e2f3c0e3113eea4b777c0d0623ab63..b3d666ba226482636753d1b751b82f5b9b0b25c0 100644 (file)
@@ -292,7 +292,7 @@ static apr_status_t hm_file_update_stat(hm_ctx_t *ctx, hm_server_t *s, apr_pool_
             buf[bsize - 1] = 0;
             t = strchr(buf, ' ');
             if (t) {
-                ip = apr_pstrndup(pool, buf, t - buf);
+                ip = apr_pstrmemdup(pool, buf, t - buf);
             } else {
                 ip = NULL;
             }
index 77fb994ff1a8de93cb68f854c13f7fd551b05da2..e9e1034405af928dd9ce4ae5f02afef775571aaf 100644 (file)
@@ -162,7 +162,7 @@ static apr_status_t readfile_heartbeats(const char *path, apr_hash_t *servers,
                 continue;
             }
 
-            ip = apr_pstrndup(pool, buf, t - buf);
+            ip = apr_pstrmemdup(pool, buf, t - buf);
             t++;
 
             server = apr_hash_get(servers, ip, APR_HASH_KEY_STRING);