After running a DAG op, we check if we encountered an error during the run. If an error has occurred, and DAG refCount hits zero, we call the "OnFinish" callback where we free and release the DAG runInfo. However, after the "OnFinish" is called we access the inner fields of the DAG runInfo which may lead to a crash:
int device_complete_after_run = RedisAI_DagDeviceComplete(batch_rinfo[0]);
int dag_complete_after_run = RedisAI_DagComplete(batch_rinfo[0]);