]> git.kaiwu.me - nginx.git/commitdiff
fix segfault introduced in r1780
authorIgor Sysoev <igor@sysoev.ru>
Thu, 27 Dec 2007 18:35:52 +0000 (18:35 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Thu, 27 Dec 2007 18:35:52 +0000 (18:35 +0000)
src/event/ngx_event_openssl.c

index d1162095cf7087a36c80bf4dbc6f7cca3b0b79a8..d7fc4d223e793b274815d4bda79abe0281caa92f 100644 (file)
@@ -996,8 +996,10 @@ ngx_ssl_read_handler(ngx_event_t *rev)
 void
 ngx_ssl_free_buffer(ngx_connection_t *c)
 {
-    if (ngx_pfree(c->pool, c->ssl->buf->start) == NGX_OK) {
-        c->ssl->buf->start = NULL;
+    if (c->ssl->buf && c->ssl->buf->start) {
+        if (ngx_pfree(c->pool, c->ssl->buf->start) == NGX_OK) {
+            c->ssl->buf->start = NULL;
+        }
     }
 }