diff --git a/library/pk.c b/library/pk.c index 18db95ade..78ff5e97c 100644 --- a/library/pk.c +++ b/library/pk.c @@ -114,7 +114,7 @@ int pk_set_type( pk_context *ctx, pk_type_t type ) size = sizeof( ecdsa_context ); else #endif - size = 0; /* should never be executed */ + return( POLARSSL_ERR_PK_TYPE_MISMATCH ); if( ( ctx->data = malloc( size ) ) == NULL ) return( POLARSSL_ERR_PK_MALLOC_FAILED );