Commit 2dedb75e authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdiStreamCloseDefaultDelegate: check pointers before Free().

parent 10bb0003
......@@ -979,8 +979,16 @@ void cdiStreamCloseDefaultDelegate(stream_t *streamptr, int recordBufIsToBeDelet
cdfClose(fileID);
if (streamptr->ntsteps == 0)
{
Free(streamptr->tsteps[0].records);
Free(streamptr->tsteps[0].recIDs);
if ( streamptr->tsteps[0].records )
{
Free(streamptr->tsteps[0].records);
streamptr->tsteps[0].records = NULL;
}
if ( streamptr->tsteps[0].recIDs )
{
Free(streamptr->tsteps[0].recIDs);
streamptr->tsteps[0].recIDs = NULL;
}
}
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment