Unchecked malloc fixes
Miscellaneous unchecked malloc fixes. Also fixed some mem leaks on error
paths as I spotted them along the way.
Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 918bb86529)
Conflicts:
crypto/bio/bss_dgram.c
This commit is contained in:
@@ -708,6 +708,10 @@ int ssl3_write_bytes(SSL *s, int type, const void *buf_, int len)
|
||||
packlen *= 4;
|
||||
|
||||
wb->buf = OPENSSL_malloc(packlen);
|
||||
if(!wb->buf) {
|
||||
SSLerr(SSL_F_SSL3_WRITE_BYTES, ERR_R_MALLOC_FAILURE);
|
||||
return -1;
|
||||
}
|
||||
wb->len = packlen;
|
||||
} else if (tot == len) { /* done? */
|
||||
OPENSSL_free(wb->buf); /* free jumbo buffer */
|
||||
|
||||
Reference in New Issue
Block a user