diff options
author | Steve Holme <steve_holme@hotmail.com> | 2014-12-26 11:53:34 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2014-12-26 13:11:40 +0000 |
commit | fe43a662a25ab3903176575f1a7e0f8a04a9adc5 (patch) | |
tree | 1a4b4402532dec28a068c6281a6b8ad21a5a474a /lib/vtls/vtls.c | |
parent | 1ac4db23f74352223607c0e897d49e92ef8b86c1 (diff) |
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.
Diffstat (limited to 'lib/vtls/vtls.c')
-rw-r--r-- | lib/vtls/vtls.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 905ddd3e9..165f49b8b 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -605,22 +605,21 @@ void Curl_ssl_free_certinfo(struct SessionHandle *data) } } -int Curl_ssl_init_certinfo(struct SessionHandle * data, - int num) +CURLcode Curl_ssl_init_certinfo(struct SessionHandle *data, int num) { - struct curl_certinfo * ci = &data->info.certs; - struct curl_slist * * table; + struct curl_certinfo *ci = &data->info.certs; + struct curl_slist **table; - /* Initialize the certificate information structures. Return 0 if OK, else 1. - */ + /* Initialize the certificate information structures */ Curl_ssl_free_certinfo(data); ci->num_of_certs = num; table = calloc((size_t) num, sizeof(struct curl_slist *)); if(!table) - return 1; + return CURLE_OUT_OF_MEMORY; ci->certinfo = table; - return 0; + + return CURLE_OK; } /* |