mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-24 08:21:07 +00:00
about a issue Replace "new" variable #1782
This commit is contained in:
parent
41c23b5a49
commit
a35dbf155c
|
@ -6017,27 +6017,27 @@ static int ssl_append_key_cert( mbedtls_ssl_key_cert **head,
|
||||||
mbedtls_x509_crt *cert,
|
mbedtls_x509_crt *cert,
|
||||||
mbedtls_pk_context *key )
|
mbedtls_pk_context *key )
|
||||||
{
|
{
|
||||||
mbedtls_ssl_key_cert *new;
|
mbedtls_ssl_key_cert *new_cert;
|
||||||
|
|
||||||
new = mbedtls_calloc( 1, sizeof( mbedtls_ssl_key_cert ) );
|
new_cert = mbedtls_calloc( 1, sizeof( mbedtls_ssl_key_cert ) );
|
||||||
if( new == NULL )
|
if( new_cert == NULL )
|
||||||
return( MBEDTLS_ERR_SSL_ALLOC_FAILED );
|
return( MBEDTLS_ERR_SSL_ALLOC_FAILED );
|
||||||
|
|
||||||
new->cert = cert;
|
new_cert->cert = cert;
|
||||||
new->key = key;
|
new_cert->key = key;
|
||||||
new->next = NULL;
|
new_cert->next = NULL;
|
||||||
|
|
||||||
/* Update head is the list was null, else add to the end */
|
/* Update head is the list was null, else add to the end */
|
||||||
if( *head == NULL )
|
if( *head == NULL )
|
||||||
{
|
{
|
||||||
*head = new;
|
*head = new_cert;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mbedtls_ssl_key_cert *cur = *head;
|
mbedtls_ssl_key_cert *cur = *head;
|
||||||
while( cur->next != NULL )
|
while( cur->next != NULL )
|
||||||
cur = cur->next;
|
cur = cur->next;
|
||||||
cur->next = new;
|
cur->next = new_cert;
|
||||||
}
|
}
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
|
|
Loading…
Reference in a new issue