mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-24 20:48:19 +00:00
- Do not free uninitialized ssl context
This commit is contained in:
parent
43ae298410
commit
580153573b
1 changed files with 3 additions and 1 deletions
|
@ -298,6 +298,7 @@ int main( int argc, char *argv[] )
|
||||||
if( ret != POLARSSL_ERR_NET_WANT_READ && ret != POLARSSL_ERR_NET_WANT_WRITE )
|
if( ret != POLARSSL_ERR_NET_WANT_READ && ret != POLARSSL_ERR_NET_WANT_WRITE )
|
||||||
{
|
{
|
||||||
printf( " failed\n ! ssl_handshake returned %d\n\n", ret );
|
printf( " failed\n ! ssl_handshake returned %d\n\n", ret );
|
||||||
|
ssl_free( &ssl );
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -313,12 +314,14 @@ int main( int argc, char *argv[] )
|
||||||
if( ret == -1 )
|
if( ret == -1 )
|
||||||
{
|
{
|
||||||
printf( " failed\n ! x509parse_cert_info returned %d\n\n", ret );
|
printf( " failed\n ! x509parse_cert_info returned %d\n\n", ret );
|
||||||
|
ssl_free( &ssl );
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf( "%s\n", buf );
|
printf( "%s\n", buf );
|
||||||
|
|
||||||
ssl_close_notify( &ssl );
|
ssl_close_notify( &ssl );
|
||||||
|
ssl_free( &ssl );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
goto usage;
|
goto usage;
|
||||||
|
@ -329,7 +332,6 @@ exit:
|
||||||
net_close( server_fd );
|
net_close( server_fd );
|
||||||
x509_free( &clicert );
|
x509_free( &clicert );
|
||||||
rsa_free( &rsa );
|
rsa_free( &rsa );
|
||||||
ssl_free( &ssl );
|
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
printf( " + Press Enter to exit this program.\n" );
|
printf( " + Press Enter to exit this program.\n" );
|
||||||
|
|
Loading…
Reference in a new issue