fix memory leak in FreeValueStruct