Multiblock corrupted pointer fix
[openssl.git] / ssl / s3_pkt.c
index 4e6a41bd58ebd09f1eacd0edda1500d434b3a695..221ae039e99eaeb5442103268ac9e6137dba40e4 100644 (file)
@@ -785,7 +785,7 @@ int ssl3_write_bytes(SSL *s, int type, const void *buf_, int len)
 
             i = ssl3_write_pending(s, type, &buf[tot], nw);
             if (i <= 0) {
-                if (i < 0) {
+                if (i < 0 && (!s->wbio || !BIO_should_retry(s->wbio))) {
                     OPENSSL_free(wb->buf);
                     wb->buf = NULL;
                 }