[z1984] Fix possible memory leak in .gameobject add command

Thanks to Kid10 for pointing

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>

(based on commit 74e9f84)

(cleaned version of 996dac4)

(based on commit [s1576] - 74cbb7b)