Fix mem leak found by ASAN

2 jobs for master in 23 minutes and 50 seconds (queued for 15 minutes and 34 seconds)