Modify marshalStruct to clear the return string before using it

Change-Id: I0ef5806a5d0c0c244ad35b65a15ff07dd064642f