Fixed crash in UnMapLS for pointers not belonging to the segptr heap.

This commit is contained in:
Andreas Mohr 2000-11-30 19:58:08 +00:00 committed by Alexandre Julliard
parent ea186796eb
commit e77bdbb16a
1 changed files with 1 additions and 1 deletions

View File

@ -908,7 +908,7 @@ void WINAPI UnMapLS( SEGPTR sptr )
/* check if ptr is inside segptr heap */ /* check if ptr is inside segptr heap */
EnterCriticalSection( &segptrHeap->critSection ); EnterCriticalSection( &segptrHeap->critSection );
subheap = HEAP_FindSubHeap( segptrHeap, PTR_SEG_TO_LIN(sptr) ); subheap = HEAP_FindSubHeap( segptrHeap, PTR_SEG_TO_LIN(sptr) );
if (subheap->selector != SELECTOROF(sptr)) subheap = NULL; if ((subheap) && (subheap->selector != SELECTOROF(sptr))) subheap = NULL;
LeaveCriticalSection( &segptrHeap->critSection ); LeaveCriticalSection( &segptrHeap->critSection );
/* if not inside heap, free the selector */ /* if not inside heap, free the selector */
if (!subheap) FreeSelector16( SELECTOROF(sptr) ); if (!subheap) FreeSelector16( SELECTOROF(sptr) );