summaryrefslogtreecommitdiff
path: root/lib/libcrypto/asn1/a_set.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcrypto/asn1/a_set.c')
-rw-r--r--lib/libcrypto/asn1/a_set.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libcrypto/asn1/a_set.c b/lib/libcrypto/asn1/a_set.c
index 19bb60fca80..0f839822ff2 100644
--- a/lib/libcrypto/asn1/a_set.c
+++ b/lib/libcrypto/asn1/a_set.c
@@ -118,7 +118,7 @@ int i2d_ASN1_SET(STACK *a, unsigned char **pp, int (*func)(), int ex_tag,
}
pStart = p; /* Catch the beg of Setblobs*/
- rgSetBlob = (MYBLOB *)OPENSSL_malloc( sk_num(a) * sizeof(MYBLOB)); /* In this array
+ if (!(rgSetBlob = (MYBLOB *)OPENSSL_malloc( sk_num(a) * sizeof(MYBLOB)))) return 0; /* In this array
we will store the SET blobs */
for (i=0; i<sk_num(a); i++)
@@ -135,7 +135,7 @@ SetBlob
/* Now we have to sort the blobs. I am using a simple algo.
*Sort ptrs *Copy to temp-mem *Copy from temp-mem to user-mem*/
qsort( rgSetBlob, sk_num(a), sizeof(MYBLOB), SetBlobCmp);
- pTempMem = OPENSSL_malloc(totSize);
+ if (!(pTempMem = OPENSSL_malloc(totSize))) return 0;
/* Copy to temp mem */
p = pTempMem;