diff --git a/library/x509.c b/library/x509.c index 6f3fbb623e..586c506284 100644 --- a/library/x509.c +++ b/library/x509.c @@ -494,14 +494,9 @@ int mbedtls_x509_get_name( unsigned char **p, const unsigned char *end, } error: - prev = NULL; - /* Skip the first element as we did not allocate it */ allocated = head->next; - /* Make sure we cannot be followed along this list */ - head->next = NULL; - while( allocated != NULL ) { prev = allocated;