diff options
Diffstat (limited to 'doc/designs')
-rw-r--r-- | doc/designs/ddd/ddd-06-mem-uv.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/designs/ddd/ddd-06-mem-uv.c b/doc/designs/ddd/ddd-06-mem-uv.c index f912f68bdf..7af5a11105 100644 --- a/doc/designs/ddd/ddd-06-mem-uv.c +++ b/doc/designs/ddd/ddd-06-mem-uv.c @@ -237,11 +237,12 @@ static void on_rx_push(APP_CONN *conn) srd = SSL_read(conn->ssl, buf, buf_len); flush_write_buf(conn); - if (srd < 0) { - free(buf); + if (srd <= 0) { rc = SSL_get_error(conn->ssl, srd); - if (rc == SSL_ERROR_WANT_READ) + if (rc == SSL_ERROR_WANT_READ) { + free(buf); return; + } } conn->app_read_cb(conn, buf, srd, conn->app_read_arg); |