Merge "res_sorcery_realtime.c: Fix ref leak if object failed to apply."