diff options
author | Parménides GV <parmegv@sdf.org> | 2014-09-23 18:10:57 +0200 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2014-09-23 18:10:57 +0200 |
commit | d0e7ba3029b2fd42582413aa95773fe7dbdede90 (patch) | |
tree | 733b8601d6e3a070fc54bde280526e16d0c69507 /app/openssl/crypto/bio/bss_dgram.c | |
parent | 248ce016ac2f33df9673e90277733abfd854f27d (diff) |
Updated native subprojects from ics-openvpn.
Diffstat (limited to 'app/openssl/crypto/bio/bss_dgram.c')
-rw-r--r-- | app/openssl/crypto/bio/bss_dgram.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/openssl/crypto/bio/bss_dgram.c b/app/openssl/crypto/bio/bss_dgram.c index 54c012c4..d9967e72 100644 --- a/app/openssl/crypto/bio/bss_dgram.c +++ b/app/openssl/crypto/bio/bss_dgram.c @@ -1333,7 +1333,7 @@ static long dgram_sctp_ctrl(BIO *b, int cmd, long num, void *ptr) bio_dgram_sctp_data *data = NULL; socklen_t sockopt_len = 0; struct sctp_authkeyid authkeyid; - struct sctp_authkey *authkey; + struct sctp_authkey *authkey = NULL; data = (bio_dgram_sctp_data *)b->ptr; @@ -1388,6 +1388,11 @@ static long dgram_sctp_ctrl(BIO *b, int cmd, long num, void *ptr) /* Add new key */ sockopt_len = sizeof(struct sctp_authkey) + 64 * sizeof(uint8_t); authkey = OPENSSL_malloc(sockopt_len); + if (authkey == NULL) + { + ret = -1; + break; + } memset(authkey, 0x00, sockopt_len); authkey->sca_keynumber = authkeyid.scact_keynumber + 1; #ifndef __FreeBSD__ @@ -1399,6 +1404,8 @@ static long dgram_sctp_ctrl(BIO *b, int cmd, long num, void *ptr) memcpy(&authkey->sca_key[0], ptr, 64 * sizeof(uint8_t)); ret = setsockopt(b->num, IPPROTO_SCTP, SCTP_AUTH_KEY, authkey, sockopt_len); + OPENSSL_free(authkey); + authkey = NULL; if (ret < 0) break; /* Reset active key */ |