Fixing memory leak introduced by b552200 (closes #3050)
Merge pull request #3084 from andrsd/fix-memory-leak

Fixing memory leak introduced by b552200 (closes #3050)
Merge commit 'bead7123aaea7c4ead2fe7079cddbf82f24c0ee1'