Add some fixes (mem leaks etc) found by linting

12 jobs for master in 11 minutes and 48 seconds (queued for 2 seconds)
Status Name Job ID Coverage
  Compilation
passed cmp:cc7-gcc #2416681
docker

00:03:36

passed cmp:cc7-llvm #2416682
docker

00:02:28

passed cmp:mac1013-clang #2416683
mac

00:01:05

passed cmp:slc6-gcc #2416679
docker

00:01:59

passed cmp:slc6-llvm #2416680
docker

00:02:04

 
  Formatting
passed fmt:centos7-llvm-format #2416685
docker

00:01:02

passed fmt:slc6-llvm-format #2416684
docker

00:01:36

 
  Documentation
passed cmp:doxygen #2416686
docker

00:00:48

passed cmp:usermanual #2416687
docker

00:01:24

 
  Packaging
passed pkg:cc7-gcc #2416689
docker

00:01:24

passed pkg:slc6-gcc #2416688
docker

00:01:52

 
  Deployment
passed deploy-docker-latest #2416690
docker-image-build

00:03:17