Fix memory leaks

3 jobs for memleak200219 in 5 minutes and 58 seconds (queued for 1 second)
Status Job ID Name Coverage
  Build
passed #1667769
mingw-build

00:03:49

passed #1667767
shared-build

00:05:58

passed #1667768
static-build

00:03:43