mirror of https://github.com/wolfSSL/wolfssh.git
Fix Potential Double Free
Static analysis indicated the potential to double-free a pointer in the `wolfSSH_CTX_UseCert_buffer()` test. Loading the second cert after freeing the first cert could fail and the test cleanup would free the pointer again. Just set pointer to null after freeing.pull/943/head
parent
19d34a8df7
commit
afedde7a1d
|
|
@ -579,6 +579,7 @@ static void test_wolfSSH_CTX_UseCert_buffer(void)
|
|||
wolfSSH_CTX_UseCert_buffer(ctx, cert, certSz, 99));
|
||||
|
||||
free(cert);
|
||||
cert = NULL;
|
||||
|
||||
AssertIntEQ(0, load_file("./keys/server-cert.der", &cert, &certSz));
|
||||
AssertNotNull(cert);
|
||||
|
|
|
|||
Loading…
Reference in New Issue