From fe43a662a25ab3903176575f1a7e0f8a04a9adc5 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Fri, 26 Dec 2014 11:53:34 +0000 Subject: vtls: Use CURLcode for Curl_ssl_init_certinfo() return type The return type for this function was 0 on success and 1 on error. This was then examined by the calling functions and, in most cases, used to return CURLE_OUT_OF_MEMORY. Instead use CURLcode for the return type and return the out of memory error directly, propagating it up the call stack. --- lib/vtls/openssl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/vtls/openssl.c') diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index f0127a27e..a41447a5b 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -2241,6 +2241,7 @@ static CURLcode get_cert_chain(struct connectdata *conn, struct ssl_connect_data *connssl) { + CURLcode result; STACK_OF(X509) *sk; int i; char *bufp; @@ -2258,9 +2259,11 @@ static CURLcode get_cert_chain(struct connectdata *conn, } numcerts = sk_X509_num(sk); - if(Curl_ssl_init_certinfo(data, numcerts)) { + + result = Curl_ssl_init_certinfo(data, numcerts); + if(result) { free(bufp); - return CURLE_OUT_OF_MEMORY; + return result; } infof(data, "--- Certificate chain\n"); -- cgit v1.2.3