Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
spins:invis:rootpack
libapr1
0004-Backport-r1593600-from-1.6.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0004-Backport-r1593600-from-1.6.patch of Package libapr1
From dc099b699dc673f61a7a130d83e63a2c8c06f5bb Mon Sep 17 00:00:00 2001 From: Stefan Fritsch <sf@apache.org> Date: Fri, 9 May 2014 19:55:08 +0000 Subject: [PATCH 04/13] Backport r1593600 from 1.6: Backport r1438940 from trunk: Don't leak memnodes in apr_pvsprintf() if out of memory and no pool abort function is set git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1593610 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 5c1a1ff..20e4254 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1135,21 +1135,12 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) * room to hold the NUL terminator. */ if (ps.node->first_avail == ps.node->endp) { - if (psprintf_flush(&ps.vbuff) == -1) { - if (pool->abort_fn) { - pool->abort_fn(APR_ENOMEM); - } - - return NULL; - } + if (psprintf_flush(&ps.vbuff) == -1) + goto error; } - if (apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1) { - if (pool->abort_fn) - pool->abort_fn(APR_ENOMEM); - - return NULL; - } + if (apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1) + goto error; strp = ps.vbuff.curpos; *strp++ = '\0'; @@ -1195,6 +1186,15 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) list_insert(active, node); return strp; + +error: + if (pool->abort_fn) + pool->abort_fn(APR_ENOMEM); + if (ps.got_a_new_node) { + ps.node->next = ps.free; + allocator_free(pool->allocator, ps.node); + } + return NULL; } -- 2.0.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor