message: Refactor ReleaseTimestep and free structure allocated in ProvideTimestep for RDMA DP
diff: @@ -712,27 +712,11 @@ static void RdmaReleaseTimestep(CP_Services Svcs, DP_WS_Stream Stream_v,
  TimestepList List = Stream->Timesteps;
  Svcs->verbose(Stream->CP_Stream, "Releasing timestep %ld\n", Timestep);
  - if (Stream->Timesteps->Timestep == Timestep)
  - {
  - Stream->Timesteps = List->Next;
  - free(List);
  - }
  - else
  - {
  - TimestepList last = List;
  - List = List->Next;
  - while (List != NULL)
  +
  + while (List->Timestep != Timestep)
  {
  - if (List->Timestep == Timestep)
  + if (List == NULL)
  {
  - last->Next = List->Next;
  - fi_close((struct fid *)List->mr); // to be expanded
  - free(List);
  - return;
  - }
  - last = List;
  - List = List->Next;
  - }
  /*
  * Shouldn't ever get here because we should never release a
  * timestep that we don't have.
  @@ -741,6 +725,17 @@ static void RdmaReleaseTimestep(CP_Services Svcs, DP_WS_Stream Stream_v,
  Timestep);
  assert(0);
  }
  + List = List->Next;
  + }
  + fi_close((struct fid *)List->mr);
  + if (List)
  + {
  + if (List->Data)
  + {
  + free(List->Data);
  + }
  + free(List);
  + }
  }
  static void RdmaDestroyReader(CP_Services Svcs, DP_RS_Stream RS_Stream_v)
  