commit | b1ccbdad7bef41c105b78384eafbf509af91fa36 | [log] [tgz] |
---|---|---|
author | Igor Sysoev <igor@sysoev.ru> | Thu Jul 19 19:11:57 2007 +0000 |
committer | Igor Sysoev <igor@sysoev.ru> | Thu Jul 19 19:11:57 2007 +0000 |
tree | bfe5383edba559d9a60082194f197e2badd81e60 | |
parent | 43ae46f40142ff394a2af1fad3eb62c9bf7fc8fa [diff] [blame] |
fix potential double free(), found by Coverity's Scan
diff --git a/src/core/ngx_file.c b/src/core/ngx_file.c index 55cfd7c..fcb8ff0 100644 --- a/src/core/ngx_file.c +++ b/src/core/ngx_file.c
@@ -518,6 +518,9 @@ } ctx->data = data; + + } else { + data = NULL; } for ( ;; ) { @@ -643,8 +646,8 @@ ngx_free(buf.data); } - if (ctx->alloc) { - ngx_free(ctx->data); + if (data) { + ngx_free(data); ctx->data = prev; }