diff options
author | Matt Caswell <matt@openssl.org> | 2015-03-04 17:49:51 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-03-05 09:09:57 +0000 |
commit | 918bb8652969fd53f0c390c1cd909265ed502c7e (patch) | |
tree | 883afa725e4529a992611b5b02e8b5c784463e99 /ssl | |
parent | 618be04e407a7800a7198ac87fa5e8cee7c6e10b (diff) |
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>
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/s3_pkt.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c index 11b1c5532e..f54152e8ec 100644 --- a/ssl/s3_pkt.c +++ b/ssl/s3_pkt.c @@ -727,6 +727,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 */ |