You should drop the reference with MCValueRelease before assigning a new value to an MCStringRef, so it would be better to create a temporary MCStringRef which either gets a value from  `<ep>` or kMCEmptyString if by != NULL, or gets a copy of the MCStringRef `
` otherwise.