summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/a_bytes.c
diff options
context:
space:
mode:
authorderaadt <>2014-04-21 11:37:41 +0000
committerderaadt <>2014-04-21 11:37:41 +0000
commita13698710d1bf0bac4832733da5c86886601b5d4 (patch)
treead42acc3896c553cb79781bc3a1ead69a74d55a3 /src/lib/libcrypto/asn1/a_bytes.c
parent6a6b6afb12953d4537a41790daa6abaad39258c5 (diff)
downloadopenbsd-a13698710d1bf0bac4832733da5c86886601b5d4.tar.gz
openbsd-a13698710d1bf0bac4832733da5c86886601b5d4.tar.bz2
openbsd-a13698710d1bf0bac4832733da5c86886601b5d4.zip
improve realloc/calloc/malloc patterns; ok guenther
Diffstat (limited to 'src/lib/libcrypto/asn1/a_bytes.c')
-rw-r--r--src/lib/libcrypto/asn1/a_bytes.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/asn1/a_bytes.c b/src/lib/libcrypto/asn1/a_bytes.c
index 30647c97b5..34ed7b7db2 100644
--- a/src/lib/libcrypto/asn1/a_bytes.c
+++ b/src/lib/libcrypto/asn1/a_bytes.c
@@ -99,7 +99,7 @@ d2i_ASN1_type_bytes(ASN1_STRING **a, const unsigned char **pp,
99 ret = (*a); 99 ret = (*a);
100 100
101 if (len != 0) { 101 if (len != 0) {
102 s = (unsigned char *)malloc((int)len + 1); 102 s = malloc((int)len + 1);
103 if (s == NULL) { 103 if (s == NULL) {
104 i = ERR_R_MALLOC_FAILURE; 104 i = ERR_R_MALLOC_FAILURE;
105 goto err; 105 goto err;
@@ -205,7 +205,7 @@ d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp,
205 if ((ret->length < len) || (ret->data == NULL)) { 205 if ((ret->length < len) || (ret->data == NULL)) {
206 if (ret->data != NULL) 206 if (ret->data != NULL)
207 free(ret->data); 207 free(ret->data);
208 s = (unsigned char *)malloc((int)len + 1); 208 s = malloc(len + 1);
209 if (s == NULL) { 209 if (s == NULL) {
210 i = ERR_R_MALLOC_FAILURE; 210 i = ERR_R_MALLOC_FAILURE;
211 goto err; 211 goto err;