Fix read-after-free in test multiple_prepared_statements-t

The test closes half the MySQL connections and later tries to close all
the connections, even the ones that have been closed before.
pull/4104/head
Javier Sánchez Parra 3 years ago
parent d220a42599
commit b275ff345f

@ -269,7 +269,9 @@ int main(int argc, char** argv) {
}
}
for (int i=0; i<NCONNS; i++) {
// Half of the connections were freed earlier. We only iterate the other
// half that has not been freed.
for (int i=1; i<NCONNS; i+=2) {
mysql_close(conns[i]);
}

Loading…
Cancel
Save