ccf->oldpid.len = ccf->pid.len + sizeof(NGX_OLDPID_EXT);
- ccf->oldpid.data = ngx_palloc(cycle->pool, ccf->oldpid.len);
+ ccf->oldpid.data = ngx_pnalloc(cycle->pool, ccf->oldpid.len);
if (ccf->oldpid.data == NULL) {
return NGX_CONF_ERROR;
}
} else {
cycle->lock_file.len = ccf->lock_file.len + 1;
- cycle->lock_file.data = ngx_palloc(cycle->pool,
+ cycle->lock_file.data = ngx_pnalloc(cycle->pool,
ccf->lock_file.len + sizeof(".accept"));
if (cycle->lock_file.data == NULL) {
return NGX_CONF_ERROR;
p = a->pool;
- if ((u_char *) a->elts + a->size * a->nalloc == p->last) {
- p->last -= a->size * a->nalloc;
+ if ((u_char *) a->elts + a->size * a->nalloc == p->d.last) {
+ p->d.last -= a->size * a->nalloc;
}
- if ((u_char *) a + sizeof(ngx_array_t) == p->last) {
- p->last = (u_char *) a;
+ if ((u_char *) a + sizeof(ngx_array_t) == p->d.last) {
+ p->d.last = (u_char *) a;
}
}
p = a->pool;
- if ((u_char *) a->elts + size == p->last && p->last + a->size <= p->end)
+ if ((u_char *) a->elts + size == p->d.last
+ && p->d.last + a->size <= p->d.end)
{
/*
* the array allocation is the last in the pool
* and there is space for new allocation
*/
- p->last += a->size;
+ p->d.last += a->size;
a->nalloc++;
} else {
p = a->pool;
- if ((u_char *) a->elts + a->size * a->nalloc == p->last
- && p->last + size <= p->end)
+ if ((u_char *) a->elts + a->size * a->nalloc == p->d.last
+ && p->d.last + size <= p->d.end)
{
/*
* the array allocation is the last in the pool
* and there is space for new allocation
*/
- p->last += size;
+ p->d.last += size;
a->nalloc += n;
} else {
return NGX_ERROR;
}
- word->data = ngx_palloc(cf->pool, b->pos - start + 1);
+ word->data = ngx_pnalloc(cf->pool, b->pos - start + 1);
if (word->data == NULL) {
return NGX_ERROR;
}
}
name->len = len + old.len;
- name->data = ngx_palloc(cycle->pool, name->len + 1);
+ name->data = ngx_pnalloc(cycle->pool, name->len + 1);
if (name->data == NULL) {
return NGX_ERROR;
}
sin->sin_port = htons(port);
- ls->addr_text.data = ngx_palloc(cf->pool,
+ ls->addr_text.data = ngx_pnalloc(cf->pool,
INET_ADDRSTRLEN - 1 + sizeof(":65535") - 1);
if (ls->addr_text.data == NULL) {
return NULL;
ls[i].addr_text_max_len = INET_ADDRSTRLEN;
- ls[i].addr_text.data = ngx_palloc(cycle->pool, INET_ADDRSTRLEN - 1
- + sizeof(":65535") - 1);
+ ls[i].addr_text.data = ngx_pnalloc(cycle->pool,
+ INET_ADDRSTRLEN - 1 + sizeof(":65535") - 1);
if (ls[i].addr_text.data == NULL) {
return NGX_ERROR;
}
cycle->conf_file.len = old_cycle->conf_file.len;
- cycle->conf_file.data = ngx_palloc(pool, old_cycle->conf_file.len + 1);
+ cycle->conf_file.data = ngx_pnalloc(pool, old_cycle->conf_file.len + 1);
if (cycle->conf_file.data == NULL) {
ngx_destroy_pool(pool);
return NULL;
hostname[NGX_MAXHOSTNAMELEN - 1] = '\0';
cycle->hostname.len = ngx_strlen(hostname);
- cycle->hostname.data = ngx_palloc(pool, cycle->hostname.len);
+ cycle->hostname.data = ngx_pnalloc(pool, cycle->hostname.len);
if (cycle->hostname.data == NULL) {
ngx_destroy_pool(pool);
return NULL;
#else
- lock_file = ngx_palloc(cycle->pool,
- cycle->lock_file.len + shm_zone[i].name.len);
+ lock_file = ngx_pnalloc(cycle->pool,
+ cycle->lock_file.len + shm_zone[i].name.len);
if (lock_file == NULL) {
goto failed;
file->name.len = path->name.len + 1 + path->len + 10;
- file->name.data = ngx_palloc(pool, file->name.len + 1);
+ file->name.data = ngx_pnalloc(pool, file->name.len + 1);
if (file->name.data == NULL) {
return NGX_ERROR;
}
}
name->len = last - 1;
- name->data = ngx_palloc(ha->temp_pool, name->len);
+ name->data = ngx_pnalloc(ha->temp_pool, name->len);
if (name->data == NULL) {
return NGX_ERROR;
}
* and ".example.com" to "com.example\0"
*/
- p = ngx_palloc(ha->temp_pool, last);
+ p = ngx_pnalloc(ha->temp_pool, last);
if (p == NULL) {
return NGX_ERROR;
}
last++;
- p = ngx_palloc(ha->temp_pool, last);
+ p = ngx_pnalloc(ha->temp_pool, last);
if (p == NULL) {
return NGX_ERROR;
}
}
name->len = last - skip;
- name->data = ngx_palloc(ha->temp_pool, name->len);
+ name->data = ngx_pnalloc(ha->temp_pool, name->len);
if (name->data == NULL) {
return NGX_ERROR;
}
len = INET_ADDRSTRLEN - 1 + 1 + sizeof(":65536") - 1;
- p = ngx_palloc(pool, len);
+ p = ngx_pnalloc(pool, len);
if (p == NULL) {
return NGX_ERROR;
}
u->addrs[0].sockaddr = (struct sockaddr *) sin;
u->addrs[0].socklen = sizeof(struct sockaddr_in);
- p = ngx_palloc(pool, u->host.len + sizeof(":65536") - 1);
+ p = ngx_pnalloc(pool, u->host.len + sizeof(":65536") - 1);
if (p == NULL) {
return NGX_ERROR;
}
#include <ngx_core.h>
+static void *ngx_palloc_block(ngx_pool_t *pool, size_t size);
+static void *ngx_palloc_large(ngx_pool_t *pool, size_t size);
+
+
ngx_pool_t *
ngx_create_pool(size_t size, ngx_log_t *log)
{
return NULL;
}
- p->last = (u_char *) p + sizeof(ngx_pool_t);
- p->end = (u_char *) p + size;
+ p->d.last = (u_char *) p + sizeof(ngx_pool_t);
+ p->d.end = (u_char *) p + size;
+ p->d.next = NULL;
+
+ p->max = (size < NGX_MAX_ALLOC_FROM_POOL) ? size - sizeof(ngx_pool_t):
+ NGX_MAX_ALLOC_FROM_POOL;
p->current = p;
p->chain = NULL;
- p->next = NULL;
p->large = NULL;
p->cleanup = NULL;
p->log = log;
* so we can not use this log while the free()ing the pool
*/
- for (p = pool, n = pool->next; /* void */; p = n, n = n->next) {
+ for (p = pool, n = pool->d.next; /* void */; p = n, n = n->d.next) {
ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, pool->log, 0,
- "free: %p, unused: %uz", p, p->end - p->last);
+ "free: %p, unused: %uz", p, p->d.end - p->d.last);
if (n == NULL) {
break;
#endif
- for (p = pool, n = pool->next; /* void */; p = n, n = n->next) {
+ for (p = pool, n = pool->d.next; /* void */; p = n, n = n->d.next) {
ngx_free(p);
if (n == NULL) {
void *
ngx_palloc(ngx_pool_t *pool, size_t size)
{
- u_char *m;
- ngx_pool_t *p, *n, *current;
- ngx_pool_large_t *large;
+ u_char *m;
+ ngx_pool_t *p;
- if (size <= (size_t) NGX_MAX_ALLOC_FROM_POOL
- && size <= (size_t) (pool->end - (u_char *) pool)
- - (size_t) ngx_align_ptr(sizeof(ngx_pool_t), NGX_ALIGNMENT))
- {
- p = pool->current;
- current = p;
+ if (size <= pool->max) {
- for ( ;; ) {
+ p = pool->current;
- /*
- * allow non-aligned memory blocks for small allocations (1, 2,
- * or 3 bytes) and for odd length strings (struct's have aligned
- * size)
- */
+ do {
+ m = ngx_align_ptr(p->d.last, NGX_ALIGNMENT);
- if (size < sizeof(int) || (size & 1)) {
- m = p->last;
+ if ((size_t) (p->d.end - m) >= size) {
+ p->d.last = m + size;
- } else {
- m = ngx_align_ptr(p->last, NGX_ALIGNMENT);
+ return m;
}
- if ((size_t) (p->end - m) >= size) {
- p->last = m + size;
+ p = p->d.next;
+
+ } while (p);
+
+ return ngx_palloc_block(pool, size);
+ }
+
+ return ngx_palloc_large(pool, size);
+}
+
+
+void *
+ngx_pnalloc(ngx_pool_t *pool, size_t size)
+{
+ u_char *m;
+ ngx_pool_t *p;
+
+ if (size <= pool->max) {
+
+ p = pool->current;
+
+ do {
+ m = p->d.last;
+
+ if ((size_t) (p->d.end - m) >= size) {
+ p->d.last = m + size;
return m;
}
- if ((size_t) (p->end - m) < NGX_ALIGNMENT) {
- current = p->next;
- }
+ p = p->d.next;
- if (p->next == NULL) {
- break;
- }
+ } while (p);
- p = p->next;
- pool->current = current;
- }
+ return ngx_palloc_block(pool, size);
+ }
- /* allocate a new pool block */
+ return ngx_palloc_large(pool, size);
+}
- n = ngx_create_pool((size_t) (p->end - (u_char *) p), p->log);
- if (n == NULL) {
- return NULL;
- }
- pool->current = current ? current : n;
+static void *
+ngx_palloc_block(ngx_pool_t *pool, size_t size)
+{
+ u_char *m;
+ ngx_pool_t *p, *new, *current;
+
+ new = ngx_create_pool((size_t) (pool->d.end - (u_char *) pool), pool->log);
+ if (new == NULL) {
+ return NULL;
+ }
- p->next = n;
- m = ngx_align_ptr(n->last, NGX_ALIGNMENT);
- n->last = m + size;
+ current = pool->current;
- return m;
+ for (p = current; p->d.next; p = p->d.next) {
+ if ((size_t) (p->d.end - p->d.last) < NGX_ALIGNMENT) {
+ current = p->d.next;
+ }
}
+ p->d.next = new;
+
+ pool->current = current ? current : new;
+
+ m = (u_char *) new + sizeof(ngx_pool_data_t);
+ new->d.last = m + size;
+
+ return m;
+}
+
+
+static void *
+ngx_palloc_large(ngx_pool_t *pool, size_t size)
+{
+ void *p;
+ ngx_pool_large_t *large;
+
#if 0
p = ngx_memalign(ngx_pagesize, size, pool->log);
if (p == NULL) {
}
-void *
-ngx_palloc_aligned(ngx_pool_t *pool, size_t size)
-{
- if (size & 1) {
- size++;
- }
-
- return ngx_palloc(pool, size);
-}
-
-
ngx_int_t
ngx_pfree(ngx_pool_t *pool, void *p)
{
};
-struct ngx_pool_s {
+typedef struct {
u_char *last;
u_char *end;
+ ngx_pool_t *next;
+} ngx_pool_data_t;
+
+
+struct ngx_pool_s {
+ ngx_pool_data_t d;
+ size_t max;
ngx_pool_t *current;
ngx_chain_t *chain;
- ngx_pool_t *next;
ngx_pool_large_t *large;
ngx_pool_cleanup_t *cleanup;
ngx_log_t *log;
void ngx_destroy_pool(ngx_pool_t *pool);
void *ngx_palloc(ngx_pool_t *pool, size_t size);
-void *ngx_palloc_aligned(ngx_pool_t *pool, size_t size);
+void *ngx_pnalloc(ngx_pool_t *pool, size_t size);
void *ngx_pcalloc(ngx_pool_t *pool, size_t size);
ngx_int_t ngx_pfree(ngx_pool_t *pool, void *p);
#endif
if (pool) {
- return ngx_palloc_aligned(pool, size);
+ return ngx_palloc(pool, size);
}
return NULL;
{
u_char *dst;
- dst = ngx_palloc(pool, src->len);
+ dst = ngx_pnalloc(pool, src->len);
if (dst == NULL) {
return NULL;
}
#endif
if (ls->addr_ntop) {
- c->addr_text.data = ngx_palloc(c->pool, ls->addr_text_max_len);
+ c->addr_text.data = ngx_pnalloc(c->pool, ls->addr_text_max_len);
if (c->addr_text.data == NULL) {
ngx_close_accepted_connection(c);
return;
}
if (c->listening->addr_ntop) {
- c->addr_text.data = ngx_palloc(c->pool,
- c->listening->addr_text_max_len);
+ c->addr_text.data = ngx_pnalloc(c->pool,
+ c->listening->addr_text_max_len);
if (c->addr_text.data == NULL) {
/* TODO: close socket */
return;
len = BIO_pending(bio);
s->len = len;
- s->data = ngx_palloc(pool, len);
+ s->data = ngx_pnalloc(pool, len);
if (s->data == NULL) {
goto failed;
}
for (len = 0; p[len]; len++) { /* void */ }
s->len = len;
- s->data = ngx_palloc(pool, len);
+ s->data = ngx_pnalloc(pool, len);
if (s->data == NULL) {
OPENSSL_free(p);
X509_free(cert);
for (len = 0; p[len]; len++) { /* void */ }
s->len = len;
- s->data = ngx_palloc(pool, len);
+ s->data = ngx_pnalloc(pool, len);
if (s->data == NULL) {
OPENSSL_free(p);
X509_free(cert);
len = BIO_pending(bio);
s->len = len;
- s->data = ngx_palloc(pool, len);
+ s->data = ngx_pnalloc(pool, len);
if (s->data == NULL) {
BIO_free(bio);
X509_free(cert);
if (state == sw_passwd) {
pwd.len = i - passwd;
- pwd.data = ngx_palloc(r->pool, pwd.len + 1);
+ pwd.data = ngx_pnalloc(r->pool, pwd.len + 1);
if (pwd.data == NULL) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
len = sizeof("Basic realm=\"") - 1 + realm->len + 1;
- basic = ngx_palloc(cf->pool, len);
+ basic = ngx_pnalloc(cf->pool, len);
if (basic == NULL) {
return NGX_CONF_ERROR;
}
allocated = path.len + 1 + len + 1
+ NGX_HTTP_AUTOINDEX_PREALLOCATE;
- filename = ngx_palloc(pool, allocated);
+ filename = ngx_pnalloc(pool, allocated);
if (filename == NULL) {
return ngx_http_autoindex_error(r, &dir, &path);
}
entry->name.len = len;
- entry->name.data = ngx_palloc(pool, len + 1);
+ entry->name.data = ngx_pnalloc(pool, len + 1);
if (entry->name.data == NULL) {
return ngx_http_autoindex_error(r, &dir, &path);
}
location = path + clcf->root.len;
} else {
- location = ngx_palloc(r->pool, r->uri.len);
+ location = ngx_pnalloc(r->pool, r->uri.len);
if (location == NULL) {
return NGX_ERROR;
}
size += part[i].end - part[i].start;
}
- p = ngx_palloc(r->pool, size);
+ p = ngx_pnalloc(r->pool, size);
if (p == NULL) {
return NGX_ERROR;
}
h->value.data = r->header_start;
h->value.data[h->value.len] = '\0';
- h->lowcase_key = ngx_palloc(r->pool, h->key.len);
+ h->lowcase_key = ngx_pnalloc(r->pool, h->key.len);
if (h->lowcase_key == NULL) {
return NGX_ERROR;
}
h->key.len = r->header_name_end - r->header_name_start;
h->value.len = r->header_end - r->header_start;
- h->key.data = ngx_palloc(r->pool,
- h->key.len + 1 + h->value.len + 1
- + h->key.len);
+ h->key.data = ngx_pnalloc(r->pool,
+ h->key.len + 1 + h->value.len + 1
+ + h->key.len);
if (h->key.data == NULL) {
return NGX_ERROR;
}
v->len = r->uri.len + flcf->index.len;
- v->data = ngx_palloc(r->pool, v->len);
+ v->data = ngx_pnalloc(r->pool, v->len);
if (v->data == NULL) {
return NGX_ERROR;
}
return NGX_OK;
}
- v->data = ngx_palloc(r->pool, NGX_INT32_LEN + 3);
+ v->data = ngx_pnalloc(r->pool, NGX_INT32_LEN + 3);
if (v->data == NULL) {
return NGX_ERROR;
}
type->len = value[i].len;
- type->data = ngx_palloc(cf->pool, type->len + 1);
+ type->data = ngx_pnalloc(cf->pool, type->len + 1);
if (type->data == NULL) {
return NGX_CONF_ERROR;
}
return NGX_OK;
}
- expires->value.data = ngx_palloc(r->pool, len);
+ expires->value.data = ngx_pnalloc(r->pool, len);
if (expires->value.data == NULL) {
return NGX_ERROR;
}
return NGX_OK;
}
- cc->value.data = ngx_palloc(r->pool,
- sizeof("max-age=") + NGX_TIME_T_LEN + 1);
+ cc->value.data = ngx_pnalloc(r->pool,
+ sizeof("max-age=") + NGX_TIME_T_LEN + 1);
if (cc->value.data == NULL) {
return NGX_ERROR;
}
uri.data = path.data + root;
} else {
- uri.data = ngx_palloc(r->pool, uri.len);
+ uri.data = ngx_pnalloc(r->pool, uri.len);
if (uri.data == NULL) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
}
}
- line = ngx_palloc(r->pool, len);
+ line = ngx_pnalloc(r->pool, len);
if (line == NULL) {
return NGX_ERROR;
}
} else {
op->run = ngx_http_log_copy_long;
- p = ngx_palloc(cf->pool, len);
+ p = ngx_pnalloc(cf->pool, len);
if (p == NULL) {
return NGX_CONF_ERROR;
}
return NGX_OK;
}
- name = ngx_palloc(r->pool, len);
+ name = ngx_pnalloc(r->pool, len);
if (name == NULL) {
return NGX_ERROR;
}
u->state->status = ctx->status;
u->headers_in.status_line.len = ctx->status_end - ctx->status_start;
- u->headers_in.status_line.data = ngx_palloc(r->pool,
- u->headers_in.status_line.len);
+ u->headers_in.status_line.data = ngx_pnalloc(r->pool,
+ u->headers_in.status_line.len);
if (u->headers_in.status_line.data == NULL) {
return NGX_ERROR;
}
h->key.len = r->header_name_end - r->header_name_start;
h->value.len = r->header_end - r->header_start;
- h->key.data = ngx_palloc(r->pool,
+ h->key.data = ngx_pnalloc(r->pool,
h->key.len + 1 + h->value.len + 1 + h->key.len);
if (h->key.data == NULL) {
return NGX_ERROR;
v->len = r->headers_in.x_forwarded_for->value.len
+ sizeof(", ") - 1 + r->connection->addr_text.len;
- p = ngx_palloc(r->pool, v->len);
+ p = ngx_pnalloc(r->pool, v->len);
if (p == NULL) {
return NGX_ERROR;
}
v->no_cacheable = 0;
v->not_found = 0;
- v->data = ngx_palloc(r->connection->pool, NGX_SIZE_T_LEN);
+ v->data = ngx_pnalloc(r->connection->pool, NGX_SIZE_T_LEN);
if (v->data == NULL) {
return NGX_ERROR;
len = prefix + pr->replacement.text.len + h->value.len - pr->redirect.len;
- data = ngx_palloc(r->pool, len);
+ data = ngx_pnalloc(r->pool, len);
if (data == NULL) {
return NGX_ERROR;
}
len += lcode(&e);
}
- data = ngx_palloc(r->pool, len);
+ data = ngx_pnalloc(r->pool, len);
if (data == NULL) {
return NGX_ERROR;
}
content_range->key.len = sizeof("Content-Range") - 1;
content_range->key.data = (u_char *) "Content-Range";
- content_range->value.data = ngx_palloc(r->pool,
+ content_range->value.data = ngx_pnalloc(r->pool,
sizeof("bytes */") - 1 + NGX_OFF_T_LEN);
if (content_range->value.data == NULL) {
return NGX_ERROR;
content_range->key.data = (u_char *) "Content-Range";
content_range->value.data =
- ngx_palloc(r->pool, sizeof("bytes -/") - 1 + 3 * NGX_OFF_T_LEN);
+ ngx_pnalloc(r->pool, sizeof("bytes -/") - 1 + 3 * NGX_OFF_T_LEN);
if (content_range->value.data == NULL) {
return NGX_ERROR;
}
len += sizeof("; charset=") - 1 + r->headers_out.charset.len;
}
- ctx->boundary_header.data = ngx_palloc(r->pool, len);
+ ctx->boundary_header.data = ngx_pnalloc(r->pool, len);
if (ctx->boundary_header.data == NULL) {
return NGX_ERROR;
}
}
r->headers_out.content_type.data =
- ngx_palloc(r->pool,
- sizeof("Content-Type: multipart/byteranges; boundary=") - 1
- + NGX_ATOMIC_T_LEN);
+ ngx_pnalloc(r->pool,
+ sizeof("Content-Type: multipart/byteranges; boundary=") - 1
+ + NGX_ATOMIC_T_LEN);
if (r->headers_out.content_type.data == NULL) {
return NGX_ERROR;
/* the size of the range: "SSSS-EEEE/TTTT" CRLF CRLF */
range[i].content_range.data =
- ngx_palloc(r->pool, 3 * NGX_OFF_T_LEN + 2 + 4);
+ ngx_pnalloc(r->pool, 3 * NGX_OFF_T_LEN + 2 + 4);
if (range[i].content_range.data == NULL) {
return NGX_ERROR;
b->temporary = 1;
b->last_buf = 1;
- b->pos = ngx_palloc(r->pool, sizeof(CRLF "--") - 1 + NGX_ATOMIC_T_LEN
- + sizeof("--" CRLF) - 1);
+ b->pos = ngx_pnalloc(r->pool, sizeof(CRLF "--") - 1 + NGX_ATOMIC_T_LEN
+ + sizeof("--" CRLF) - 1);
if (b->pos == NULL) {
return NGX_ERROR;
}
return NGX_DECLINED;
}
- p = ngx_palloc(r->connection->pool, len);
+ p = ngx_pnalloc(r->connection->pool, len);
if (p == NULL) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
default:
ctx->command.len = 1;
- ctx->command.data = ngx_palloc(r->pool,
- NGX_HTTP_SSI_COMMAND_LEN);
+ ctx->command.data = ngx_pnalloc(r->pool,
+ NGX_HTTP_SSI_COMMAND_LEN);
if (ctx->command.data == NULL) {
return NGX_ERROR;
}
}
ctx->param->key.len = 1;
- ctx->param->key.data = ngx_palloc(r->pool,
- NGX_HTTP_SSI_PARAM_LEN);
+ ctx->param->key.data = ngx_pnalloc(r->pool,
+ NGX_HTTP_SSI_PARAM_LEN);
if (ctx->param->key.data == NULL) {
return NGX_ERROR;
}
ctx->param->value.len = 0;
if (ctx->value_buf == NULL) {
- ctx->param->value.data = ngx_palloc(r->pool,
- ctx->value_len);
+ ctx->param->value.data = ngx_pnalloc(r->pool,
+ ctx->value_len);
if (ctx->param->value.data == NULL) {
return NGX_ERROR;
}
case ssi_postparam_state:
if (ctx->param->value.len + 1 < ctx->value_len / 2) {
- value = ngx_palloc(r->pool, ctx->param->value.len + 1);
+ value = ngx_pnalloc(r->pool, ctx->param->value.len + 1);
if (value == NULL) {
return NGX_ERROR;
}
if (prefix) {
len = prefix + text->len;
- data = ngx_palloc(r->pool, len);
+ data = ngx_pnalloc(r->pool, len);
if (data == NULL) {
return NGX_ERROR;
}
}
}
- p = ngx_palloc(r->pool, len + ((flags & NGX_HTTP_SSI_ADD_ZERO) ? 1 : 0));
+ p = ngx_pnalloc(r->pool, len + ((flags & NGX_HTTP_SSI_ADD_ZERO) ? 1 : 0));
if (p == NULL) {
return NGX_ERROR;
}
NGX_ESCAPE_HTML);
if (len) {
- p = ngx_palloc(r->pool, value->len + len);
+ p = ngx_pnalloc(r->pool, value->len + len);
if (p == NULL) {
return NGX_HTTP_SSI_ERROR;
}
len = ngx_escape_html(NULL, value->data, value->len);
if (len) {
- p = ngx_palloc(r->pool, value->len + len);
+ p = ngx_pnalloc(r->pool, value->len + len);
if (p == NULL) {
return NGX_HTTP_SSI_ERROR;
}
if (value) {
ctx->timefmt.len = value->len;
- ctx->timefmt.data = ngx_palloc(r->pool, value->len + 1);
+ ctx->timefmt.data = ngx_pnalloc(r->pool, value->len + 1);
if (ctx->timefmt.data == NULL) {
return NGX_HTTP_SSI_ERROR;
}
|| (ctx->timefmt.len == sizeof("%s") - 1
&& ctx->timefmt.data[0] == '%' && ctx->timefmt.data[1] == 's'))
{
- v->data = ngx_palloc(r->pool, NGX_TIME_T_LEN);
+ v->data = ngx_pnalloc(r->pool, NGX_TIME_T_LEN);
if (v->data == NULL) {
return NGX_ERROR;
}
return NGX_ERROR;
}
- v->data = ngx_palloc(r->pool, v->len);
+ v->data = ngx_pnalloc(r->pool, v->len);
if (v->data == NULL) {
return NGX_ERROR;
}
type->len = value[i].len;
- type->data = ngx_palloc(cf->pool, type->len + 1);
+ type->data = ngx_pnalloc(cf->pool, type->len + 1);
if (type->data == NULL) {
return NGX_CONF_ERROR;
}
len += r->args.len + 1;
}
- location = ngx_palloc(r->pool, len);
+ location = ngx_pnalloc(r->pool, len);
if (location == NULL) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
type->len = value[i].len;
- type->data = ngx_palloc(cf->pool, type->len + 1);
+ type->data = ngx_pnalloc(cf->pool, type->len + 1);
if (type->data == NULL) {
return NGX_CONF_ERROR;
}
len += conf->domain.len;
}
- cookie = ngx_palloc(r->pool, len);
+ cookie = ngx_pnalloc(r->pool, len);
if (cookie == NULL) {
return NGX_ERROR;
}
ngx_str_t *name, uint32_t *uid)
{
v->len = name->len + sizeof("=00001111222233334444555566667777") - 1;
- v->data = ngx_palloc(r->pool, v->len);
+ v->data = ngx_pnalloc(r->pool, v->len);
if (v->data == NULL) {
return NGX_ERROR;
}
return NGX_CONF_OK;
}
- new = ngx_palloc(cf->pool, sizeof("; domain=") - 1 + domain->len);
+ new = ngx_pnalloc(cf->pool, sizeof("; domain=") - 1 + domain->len);
if (new == NULL) {
return NGX_CONF_ERROR;
}
u_char *p, *new;
- new = ngx_palloc(cf->pool, sizeof("; path=") - 1 + path->len);
+ new = ngx_pnalloc(cf->pool, sizeof("; path=") - 1 + path->len);
if (new == NULL) {
return NGX_CONF_ERROR;
}
return NGX_OK;
}
- s->data = ngx_palloc(r->pool, len);
+ s->data = ngx_pnalloc(r->pool, len);
if (s->data == NULL) {
return NGX_ERROR;
}
/* look up hashed headers */
- lowcase_key = ngx_palloc(r->pool, len);
+ lowcase_key = ngx_pnalloc(r->pool, len);
if (lowcase_key == NULL) {
XSRETURN_UNDEF;
}
size += ph[i]->value.len + sizeof("; ") - 1;
}
- cookie = ngx_palloc(r->pool, size);
+ cookie = ngx_pnalloc(r->pool, size);
if (cookie == NULL) {
XSRETURN_UNDEF;
}
src = (u_char *) SvPV(text, len);
- p = ngx_palloc(r->pool, len + 1);
+ p = ngx_pnalloc(r->pool, len + 1);
if (p == NULL) {
XSRETURN_UNDEF;
}
p = (u_char *) SvPV(name, len);
- lowcase = ngx_palloc(r->pool, len);
+ lowcase = ngx_pnalloc(r->pool, len);
if (lowcase == NULL) {
XSRETURN_UNDEF;
}
line = SvPVx(POPs, n_a);
rv->len = n_a;
- rv->data = ngx_palloc(r->pool, n_a);
+ rv->data = ngx_pnalloc(r->pool, n_a);
if (rv->data == NULL) {
return NGX_ERROR;
}
lq = (ngx_http_location_queue_t *) q;
len = lq->name->len - prefix;
- node = ngx_palloc_aligned(cf->pool,
- offsetof(ngx_http_location_tree_node_t, name) + len);
+ node = ngx_palloc(cf->pool,
+ offsetof(ngx_http_location_tree_node_t, name) + len);
if (node == NULL) {
return NULL;
}
hip->port = in_port->port;
- hip->port_text.data = ngx_palloc(cf->pool, 7);
+ hip->port_text.data = ngx_pnalloc(cf->pool, 7);
if (hip->port_text.data == NULL) {
return NGX_ERROR;
}
} else {
len = clcf->name.len + 1 + r->args.len;
- p = ngx_palloc(r->pool, len);
+ p = ngx_pnalloc(r->pool, len);
if (p == NULL) {
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
if (c >= 'A' && c <= 'Z') {
- p = ngx_palloc(r->pool, r->exten.len);
+ p = ngx_pnalloc(r->pool, r->exten.len);
if (p == NULL) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
path->len = clcf->root.len + reserved;
- path->data = ngx_palloc(r->pool, path->len);
+ path->data = ngx_pnalloc(r->pool, path->len);
if (path->data == NULL) {
return NULL;
}
}
auth.len = ngx_base64_decoded_length(encoded.len);
- auth.data = ngx_palloc(r->pool, auth.len + 1);
+ auth.data = ngx_pnalloc(r->pool, auth.len + 1);
if (auth.data == NULL) {
return NGX_ERROR;
}
if (r->complex_uri || r->quoted_uri) {
- r->uri.data = ngx_palloc(r->pool, r->uri.len + 1);
+ r->uri.data = ngx_pnalloc(r->pool, r->uri.len + 1);
if (r->uri.data == NULL) {
ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
return;
h->value.data = r->header_start;
h->value.data[h->value.len] = '\0';
- h->lowcase_key = ngx_palloc(r->pool, h->key.len);
+ h->lowcase_key = ngx_pnalloc(r->pool, h->key.len);
if (h->lowcase_key == NULL) {
ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
return;
server = buf;
} else {
- server = ngx_palloc(r->pool, len);
+ server = ngx_pnalloc(r->pool, len);
if (server == NULL) {
return NGX_ERROR;
}
value->len = len;
- value->data = ngx_palloc(r->pool, len);
+ value->data = ngx_pnalloc(r->pool, len);
if (value->data == NULL) {
return NULL;
}
e->buf.len += r->args.len + 1;
}
- e->buf.data = ngx_palloc(r->pool, e->buf.len);
+ e->buf.data = ngx_pnalloc(r->pool, e->buf.len);
if (e->buf.data == NULL) {
e->ip = ngx_http_script_exit;
e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
}
e->buf.len = len;
- e->buf.data = ngx_palloc(e->request->pool, len);
+ e->buf.data = ngx_pnalloc(e->request->pool, len);
if (e->buf.data == NULL) {
e->ip = ngx_http_script_exit;
e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
}
}
- p = ngx_palloc(r->pool, len);
+ p = ngx_pnalloc(r->pool, len);
if (p == NULL) {
return NGX_ERROR;
}
len = r->upstream_states->nelts * (3 + 2);
- p = ngx_palloc(r->pool, len);
+ p = ngx_pnalloc(r->pool, len);
if (p == NULL) {
return NGX_ERROR;
}
len = r->upstream_states->nelts * (NGX_TIME_T_LEN + 4 + 2);
- p = ngx_palloc(r->pool, len);
+ p = ngx_pnalloc(r->pool, len);
if (p == NULL) {
return NGX_ERROR;
}
len = INET_ADDRSTRLEN - 1 + 1 + sizeof(":65536") - 1;
- p = ngx_palloc(r->pool, len);
+ p = ngx_pnalloc(r->pool, len);
if (p == NULL) {
return NGX_ERROR;
}
}
v->name.len = name->len;
- v->name.data = ngx_palloc(cf->pool, name->len);
+ v->name.data = ngx_pnalloc(cf->pool, name->len);
if (v->name.data == NULL) {
return NULL;
}
}
v->name.len = name->len;
- v->name.data = ngx_palloc(cf->pool, name->len);
+ v->name.data = ngx_pnalloc(cf->pool, name->len);
if (v->name.data == NULL) {
return NGX_ERROR;
}
len += h[i]->value.len + sizeof("; ") - 1;
}
- p = ngx_palloc(r->pool, len);
+ p = ngx_pnalloc(r->pool, len);
if (p == NULL) {
return NGX_ERROR;
}
v->no_cacheable = 0;
v->not_found = 0;
- v->data = ngx_palloc(r->pool, sizeof("65535") - 1);
+ v->data = ngx_pnalloc(r->pool, sizeof("65535") - 1);
if (v->data == NULL) {
return NGX_ERROR;
}
{
ngx_str_t s;
- s.data = ngx_palloc(r->pool, INET_ADDRSTRLEN);
+ s.data = ngx_pnalloc(r->pool, INET_ADDRSTRLEN);
if (s.data == NULL) {
return NGX_ERROR;
}
sent = 0;
}
- p = ngx_palloc(r->pool, NGX_OFF_T_LEN);
+ p = ngx_pnalloc(r->pool, NGX_OFF_T_LEN);
if (p == NULL) {
return NGX_ERROR;
}
}
if (r->headers_out.content_length_n >= 0) {
- p = ngx_palloc(r->pool, NGX_OFF_T_LEN);
+ p = ngx_pnalloc(r->pool, NGX_OFF_T_LEN);
if (p == NULL) {
return NGX_ERROR;
}
}
if (r->headers_out.last_modified_time >= 0) {
- p = ngx_palloc(r->pool,
+ p = ngx_pnalloc(r->pool,
sizeof("Last-Modified: Mon, 28 Sep 1970 06:00:00 GMT") - 1);
if (p == NULL) {
return NGX_ERROR;
if (clcf->keepalive_header) {
- p = ngx_palloc(r->pool, sizeof("timeout=") - 1 + NGX_TIME_T_LEN);
+ p = ngx_pnalloc(r->pool, sizeof("timeout=") - 1 + NGX_TIME_T_LEN);
if (p == NULL) {
return NGX_ERROR;
}
imip->addrs[i].addr = in_addr[i].addr;
imip->addrs[i].ctx = in_addr[i].ctx;
- text = ngx_palloc(cf->pool,
- INET_ADDRSTRLEN - 1 + sizeof(":65535") - 1);
+ text = ngx_pnalloc(cf->pool,
+ INET_ADDRSTRLEN - 1 + sizeof(":65535") - 1);
if (text == NULL) {
return NGX_CONF_ERROR;
}
{
s->login.len = ctx->header_end - ctx->header_start;
- s->login.data = ngx_palloc(s->connection->pool, s->login.len);
+ s->login.data = ngx_pnalloc(s->connection->pool, s->login.len);
if (s->login.data == NULL) {
ngx_close_connection(ctx->peer.connection);
ngx_destroy_pool(ctx->pool);
{
s->passwd.len = ctx->header_end - ctx->header_start;
- s->passwd.data = ngx_palloc(s->connection->pool, s->passwd.len);
+ s->passwd.data = ngx_pnalloc(s->connection->pool,
+ s->passwd.len);
if (s->passwd.data == NULL) {
ngx_close_connection(ctx->peer.connection);
ngx_destroy_pool(ctx->pool);
{
ctx->errcode.len = ctx->header_end - ctx->header_start;
- ctx->errcode.data = ngx_palloc(s->connection->pool,
- ctx->errcode.len);
+ ctx->errcode.data = ngx_pnalloc(s->connection->pool,
+ ctx->errcode.len);
if (ctx->errcode.data == NULL) {
ngx_close_connection(ctx->peer.connection);
ngx_destroy_pool(ctx->pool);
ctx->err.len = ctx->errcode.len + ctx->errmsg.len
+ sizeof(" " CRLF) - 1;
- p = ngx_palloc(s->connection->pool, ctx->err.len);
+ p = ngx_pnalloc(s->connection->pool, ctx->err.len);
if (p == NULL) {
ngx_close_connection(ctx->peer.connection);
ngx_destroy_pool(ctx->pool);
peer->name.len = len;
- peer->name.data = ngx_palloc(s->connection->pool, len);
+ peer->name.data = ngx_pnalloc(s->connection->pool, len);
if (peer->name.data == NULL) {
ngx_destroy_pool(ctx->pool);
ngx_mail_session_internal_server_error(s);
escaped->len = text->len + n * 2;
- p = ngx_palloc(pool, escaped->len);
+ p = ngx_pnalloc(pool, escaped->len);
if (p == NULL) {
return NGX_ERROR;
}
len += header[i].key.len + 2 + header[i].value.len + 2;
}
- p = ngx_palloc(cf->pool, len);
+ p = ngx_pnalloc(cf->pool, len);
if (p == NULL) {
return NGX_CONF_ERROR;
}
ngx_mail_salt(ngx_mail_session_t *s, ngx_connection_t *c,
ngx_mail_core_srv_conf_t *cscf)
{
- s->salt.data = ngx_palloc(c->pool,
- sizeof(" <18446744073709551616.@>" CRLF) - 1
- + NGX_TIME_T_LEN
- + cscf->server_name.len);
+ s->salt.data = ngx_pnalloc(c->pool,
+ sizeof(" <18446744073709551616.@>" CRLF) - 1
+ + NGX_TIME_T_LEN
+ + cscf->server_name.len);
if (s->salt.data == NULL) {
return NGX_ERROR;
}
"mail auth plain: \"%V\"", &arg[n]);
#endif
- plain.data = ngx_palloc(c->pool, ngx_base64_decoded_length(arg[n].len));
+ plain.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[n].len));
if (plain.data == NULL){
return NGX_ERROR;
}
ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0,
"mail auth login username: \"%V\"", &arg[0]);
- s->login.data = ngx_palloc(c->pool, ngx_base64_decoded_length(arg[0].len));
+ s->login.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[0].len));
if (s->login.data == NULL){
return NGX_ERROR;
}
"mail auth login password: \"%V\"", &arg[0]);
#endif
- s->passwd.data = ngx_palloc(c->pool, ngx_base64_decoded_length(arg[0].len));
+ s->passwd.data = ngx_pnalloc(c->pool,
+ ngx_base64_decoded_length(arg[0].len));
if (s->passwd.data == NULL){
return NGX_ERROR;
}
ngx_str_t salt;
ngx_uint_t n;
- p = ngx_palloc(c->pool, len + ngx_base64_encoded_length(s->salt.len) + 2);
+ p = ngx_pnalloc(c->pool, len + ngx_base64_encoded_length(s->salt.len) + 2);
if (p == NULL) {
return NGX_ERROR;
}
ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0,
"mail auth cram-md5: \"%V\"", &arg[0]);
- s->login.data = ngx_palloc(c->pool, ngx_base64_decoded_length(arg[0].len));
+ s->login.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[0].len));
if (s->login.data == NULL){
return NGX_ERROR;
}
if (s->tagged_line.len < s->tag.len + s->text.len + s->out.len) {
s->tagged_line.len = s->tag.len + s->text.len + s->out.len;
- s->tagged_line.data = ngx_palloc(c->pool, s->tagged_line.len);
+ s->tagged_line.data = ngx_pnalloc(c->pool, s->tagged_line.len);
if (s->tagged_line.data == NULL) {
ngx_mail_close_connection(c);
return;
}
s->login.len = arg[0].len;
- s->login.data = ngx_palloc(c->pool, s->login.len);
+ s->login.data = ngx_pnalloc(c->pool, s->login.len);
if (s->login.data == NULL) {
return NGX_ERROR;
}
ngx_memcpy(s->login.data, arg[0].data, s->login.len);
s->passwd.len = arg[1].len;
- s->passwd.data = ngx_palloc(c->pool, s->passwd.len);
+ s->passwd.data = ngx_pnalloc(c->pool, s->passwd.len);
if (s->passwd.data == NULL) {
return NGX_ERROR;
}
}
}
- p = ngx_palloc(cf->pool, size);
+ p = ngx_pnalloc(cf->pool, size);
if (p == NULL) {
return NGX_CONF_ERROR;
}
size += sizeof(" STARTTLS") - 1;
- p = ngx_palloc(cf->pool, size);
+ p = ngx_pnalloc(cf->pool, size);
if (p == NULL) {
return NGX_CONF_ERROR;
}
size = (auth - conf->capability.data) + sizeof(CRLF) - 1
+ sizeof(" STARTTLS LOGINDISABLED") - 1;
- p = ngx_palloc(cf->pool, size);
+ p = ngx_pnalloc(cf->pool, size);
if (p == NULL) {
return NGX_CONF_ERROR;
}
return;
}
- s->out.data = ngx_palloc(c->pool, sizeof(pop3_greeting) + s->salt.len);
+ s->out.data = ngx_pnalloc(c->pool, sizeof(pop3_greeting) + s->salt.len);
if (s->out.data == NULL) {
ngx_mail_session_internal_server_error(s);
return;
arg = s->args.elts;
s->login.len = arg[0].len;
- s->login.data = ngx_palloc(c->pool, s->login.len);
+ s->login.data = ngx_pnalloc(c->pool, s->login.len);
if (s->login.data == NULL) {
return NGX_ERROR;
}
arg = s->args.elts;
s->passwd.len = arg[0].len;
- s->passwd.data = ngx_palloc(c->pool, s->passwd.len);
+ s->passwd.data = ngx_pnalloc(c->pool, s->passwd.len);
if (s->passwd.data == NULL) {
return NGX_ERROR;
}
arg = s->args.elts;
s->login.len = arg[0].len;
- s->login.data = ngx_palloc(c->pool, s->login.len);
+ s->login.data = ngx_pnalloc(c->pool, s->login.len);
if (s->login.data == NULL) {
return NGX_ERROR;
}
ngx_memcpy(s->login.data, arg[0].data, s->login.len);
s->passwd.len = arg[1].len;
- s->passwd.data = ngx_palloc(c->pool, s->passwd.len);
+ s->passwd.data = ngx_pnalloc(c->pool, s->passwd.len);
if (s->passwd.data == NULL) {
return NGX_ERROR;
}
size += sizeof("SASL LOGIN PLAIN" CRLF) - 1;
}
- p = ngx_palloc(cf->pool, size);
+ p = ngx_pnalloc(cf->pool, size);
if (p == NULL) {
return NGX_CONF_ERROR;
}
size += sizeof("STLS" CRLF) - 1;
- p = ngx_palloc(cf->pool, size);
+ p = ngx_pnalloc(cf->pool, size);
if (p == NULL) {
return NGX_CONF_ERROR;
}
}
- p = ngx_palloc(cf->pool, stls_only_size);
+ p = ngx_pnalloc(cf->pool, stls_only_size);
if (p == NULL) {
return NGX_CONF_ERROR;
}
s->connection->log->action = "sending user name to upstream";
line.len = sizeof("USER ") - 1 + s->login.len + 2;
- line.data = ngx_palloc(c->pool, line.len);
+ line.data = ngx_pnalloc(c->pool, line.len);
if (line.data == NULL) {
ngx_mail_proxy_internal_server_error(s);
return;
s->connection->log->action = "sending password to upstream";
line.len = sizeof("PASS ") - 1 + s->passwd.len + 2;
- line.data = ngx_palloc(c->pool, line.len);
+ line.data = ngx_pnalloc(c->pool, line.len);
if (line.data == NULL) {
ngx_mail_proxy_internal_server_error(s);
return;
line.len = s->tag.len + sizeof("LOGIN ") - 1
+ 1 + NGX_SIZE_T_LEN + 1 + 2;
- line.data = ngx_palloc(c->pool, line.len);
+ line.data = ngx_pnalloc(c->pool, line.len);
if (line.data == NULL) {
ngx_mail_proxy_internal_server_error(s);
return;
s->connection->log->action = "sending user name to upstream";
line.len = s->login.len + 1 + 1 + NGX_SIZE_T_LEN + 1 + 2;
- line.data = ngx_palloc(c->pool, line.len);
+ line.data = ngx_pnalloc(c->pool, line.len);
if (line.data == NULL) {
ngx_mail_proxy_internal_server_error(s);
return;
s->connection->log->action = "sending password to upstream";
line.len = s->passwd.len + 2;
- line.data = ngx_palloc(c->pool, line.len);
+ line.data = ngx_pnalloc(c->pool, line.len);
if (line.data == NULL) {
ngx_mail_proxy_internal_server_error(s);
return;
cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
line.len = sizeof("HELO ") - 1 + cscf->server_name.len + 2;
- line.data = ngx_palloc(c->pool, line.len);
+ line.data = ngx_pnalloc(c->pool, line.len);
if (line.data == NULL) {
ngx_mail_proxy_internal_server_error(s);
return;
+ s->esmtp + s->smtp_helo.len
+ s->connection->addr_text.len + s->login.len + s->host.len;
- line.data = ngx_palloc(c->pool, line.len);
+ line.data = ngx_pnalloc(c->pool, line.len);
if (line.data == NULL) {
ngx_mail_proxy_internal_server_error(s);
return;
s->smtp_helo.len = arg[0].len;
- s->smtp_helo.data = ngx_palloc(c->pool, arg[0].len);
+ s->smtp_helo.data = ngx_pnalloc(c->pool, arg[0].len);
if (s->smtp_helo.data == NULL) {
return NGX_ERROR;
}
size = sizeof("220 ESMTP ready" CRLF) - 1 + cscf->server_name.len;
- p = ngx_palloc(cf->pool, size);
+ p = ngx_pnalloc(cf->pool, size);
if (p == NULL) {
return NGX_CONF_ERROR;
}
size = sizeof("250 " CRLF) - 1 + cscf->server_name.len;
- p = ngx_palloc(cf->pool, size);
+ p = ngx_pnalloc(cf->pool, size);
if (p == NULL) {
return NGX_CONF_ERROR;
}
}
}
- p = ngx_palloc(cf->pool, size);
+ p = ngx_pnalloc(cf->pool, size);
if (p == NULL) {
return NGX_CONF_ERROR;
}
size += sizeof("250 STARTTLS" CRLF) - 1;
- p = ngx_palloc(cf->pool, size);
+ p = ngx_pnalloc(cf->pool, size);
if (p == NULL) {
return NGX_CONF_ERROR;
}
size = (auth - conf->capability.data)
+ sizeof("250 STARTTLS" CRLF) - 1;
- p = ngx_palloc(cf->pool, size);
+ p = ngx_pnalloc(cf->pool, size);
if (p == NULL) {
return NGX_CONF_ERROR;
}
m->query.len = NGX_MYSQL_CMDPKT_LEN + ngx_mysql_command_query.len;
- m->query.data = ngx_palloc(r->pool, m->query.len);
+ m->query.data = ngx_pnalloc(r->pool, m->query.len);
if (m->query.data == NULL) {
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
return;
len += 20;
}
- auth = ngx_palloc(m->pool, len);
+ auth = ngx_pnalloc(m->pool, len);
if (auth == NULL) {
ngx_mysql_close(m, NGX_ERROR);
return;
size += ngx_strlen(ngx_argv[i]) + 1;
}
- title = ngx_palloc(cycle->pool, size);
+ title = ngx_pnalloc(cycle->pool, size);
p = ngx_cpymem(title, master_process, sizeof(master_process) - 1);
for (i = 0; i < ngx_argc; i++) {
if (err == 0) {
len = ngx_strlen(value);
- *encrypted = ngx_palloc(pool, len);
+ *encrypted = ngx_pnalloc(pool, len);
if (*encrypted) {
ngx_memcpy(*encrypted, value, len + 1);
return NGX_OK;
if (value) {
len = ngx_strlen(value);
- *encrypted = ngx_palloc(pool, len);
+ *encrypted = ngx_pnalloc(pool, len);
if (*encrypted) {
ngx_memcpy(*encrypted, value, len + 1);
}