Memory leaks

### Description
Fixed three leaks, discovered during valgrind harness tests