Fix mem leak found by ASAN

2 jobs for master in 12 minutes and 41 seconds (queued for 3 seconds)
Status Job ID Name Coverage
  Build
passed #53789
build_clazy_clang_tidy

00:12:41

passed #53788
linux kf5-qt5 qt5.12

00:07:48

0.0%