1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-16 22:45:03 -05:00

schannel: fix compiler warning

When building with Unicode on MSVC, the compiler warns about freeing a
pointer to const in Curl_unicodefree. Fix this by declaring it as
non-const and casting the argument to Curl_convert_UTF8_to_tchar to
non-const too, like we do in all other places.

Closes https://github.com/curl/curl/pull/3435
This commit is contained in:
Marcel Raad 2019-01-03 15:22:44 +01:00
parent 1e4ec09a26
commit e939afeb5c
No known key found for this signature in database
GPG Key ID: 33C416EFAE4D6F02

View File

@ -7,7 +7,7 @@
* *
* Copyright (C) 2012 - 2016, Marc Hoersken, <info@marc-hoersken.de> * Copyright (C) 2012 - 2016, Marc Hoersken, <info@marc-hoersken.de>
* Copyright (C) 2012, Mark Salisbury, <mark.salisbury@hp.com> * Copyright (C) 2012, Mark Salisbury, <mark.salisbury@hp.com>
* Copyright (C) 2012 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 2012 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -87,14 +87,14 @@ static CURLcode add_certs_to_store(HCERTSTORE trust_store,
LARGE_INTEGER file_size; LARGE_INTEGER file_size;
char *ca_file_buffer = NULL; char *ca_file_buffer = NULL;
char *current_ca_file_ptr = NULL; char *current_ca_file_ptr = NULL;
const TCHAR *ca_file_tstr = NULL; TCHAR *ca_file_tstr = NULL;
size_t ca_file_bufsize = 0; size_t ca_file_bufsize = 0;
DWORD total_bytes_read = 0; DWORD total_bytes_read = 0;
bool more_certs = 0; bool more_certs = 0;
int num_certs = 0; int num_certs = 0;
size_t END_CERT_LEN; size_t END_CERT_LEN;
ca_file_tstr = Curl_convert_UTF8_to_tchar(ca_file); ca_file_tstr = Curl_convert_UTF8_to_tchar((char *)ca_file);
if(!ca_file_tstr) { if(!ca_file_tstr) {
failf(data, failf(data,
"schannel: invalid path name for CA file '%s': %s", "schannel: invalid path name for CA file '%s': %s",