mirror of
https://github.com/nginx/nginx.git
synced 2024-12-13 19:19:00 +08:00
fix potential double free(),
found by Coverity's Scan
This commit is contained in:
parent
43ae46f401
commit
b1ccbdad7b
@ -518,6 +518,9 @@ ngx_walk_tree(ngx_tree_ctx_t *ctx, ngx_str_t *tree)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ctx->data = data;
|
ctx->data = data;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( ;; ) {
|
for ( ;; ) {
|
||||||
@ -643,8 +646,8 @@ done:
|
|||||||
ngx_free(buf.data);
|
ngx_free(buf.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->alloc) {
|
if (data) {
|
||||||
ngx_free(ctx->data);
|
ngx_free(data);
|
||||||
ctx->data = prev;
|
ctx->data = prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user