merged memory leak fix from luasandbox branch
Authored by: heiko 2014-08-12
Parent: [r2767]
Child: [r2769]