mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
Add wrappers for malloc, calloc, realloc that check for out of memory
situations. Use them in most places where malloc, and friends are used. This results in clean error messages in an out of memory situation instead of segfaulting or silently malfunctioning. In some places, it just allows to remove some logging code. PR 51568, PR 51569, PR 51571. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1172686 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -1384,7 +1384,7 @@ PROXY_DECLARE(char *) ap_proxy_define_balancer(apr_pool_t *p,
|
||||
(*balancer)->lbmethod = lbmethod;
|
||||
|
||||
if (do_malloc)
|
||||
bshared = malloc(sizeof(proxy_balancer_shared));
|
||||
bshared = ap_malloc(sizeof(proxy_balancer_shared));
|
||||
else
|
||||
bshared = apr_palloc(p, sizeof(proxy_balancer_shared));
|
||||
|
||||
@@ -1798,7 +1798,7 @@ PROXY_DECLARE(char *) ap_proxy_define_worker(apr_pool_t *p,
|
||||
* if called during config, we don't have shm setup yet,
|
||||
* so just note the info for later. */
|
||||
if (do_malloc)
|
||||
wshared = malloc(sizeof(proxy_worker_shared)); /* will be freed ap_proxy_share_worker */
|
||||
wshared = ap_malloc(sizeof(proxy_worker_shared)); /* will be freed ap_proxy_share_worker */
|
||||
else
|
||||
wshared = apr_palloc(p, sizeof(proxy_worker_shared));
|
||||
|
||||
|
Reference in New Issue
Block a user