userlibandfileserver/fileserver/sfile/sf_obj.cpp
branchRCL_3
changeset 23 1df514389a47
parent 19 4a8fed1c0ef6
child 43 c1f20ce4abcf
equal deleted inserted replaced
22:2f92ad2dc5db 23:1df514389a47
   127 			TInt newAlloc=--iCount;
   127 			TInt newAlloc=--iCount;
   128 			newAlloc=(newAlloc+(KObjectConIxGranularity-1))&~(KObjectConIxGranularity-1);
   128 			newAlloc=(newAlloc+(KObjectConIxGranularity-1))&~(KObjectConIxGranularity-1);
   129 			if (newAlloc!=iAllocated)
   129 			if (newAlloc!=iAllocated)
   130 				{
   130 				{
   131 				if (newAlloc)
   131 				if (newAlloc)
       
   132 				    {
   132 					iContainers=(CFsObjectCon**)User::ReAlloc(iContainers,newAlloc*sizeof(CFsObjectCon*));
   133 					iContainers=(CFsObjectCon**)User::ReAlloc(iContainers,newAlloc*sizeof(CFsObjectCon*));
       
   134 					__ASSERT_DEBUG(iContainers,User::Panic(_L("FS_LDR panic"),ELdrHeapCorruptionOnRemove));
       
   135 				    }
   133 				else
   136 				else
   134 					{
   137 					{
   135 					delete iContainers;
   138 					delete iContainers;
   136 					iContainers=NULL;
   139 					iContainers=NULL;
   137 					}
   140 					}
   487 			} while(i>=0 && !pR->obj);
   490 			} while(i>=0 && !pR->obj);
   488 		TInt newAlloc=(i+KObjectIxGranularity)&~(KObjectIxGranularity-1);
   491 		TInt newAlloc=(i+KObjectIxGranularity)&~(KObjectIxGranularity-1);
   489 		if (newAlloc!=iAllocated)
   492 		if (newAlloc!=iAllocated)
   490 			{
   493 			{
   491 			if (newAlloc)
   494 			if (newAlloc)
       
   495 			    {
   492 				iObjects=(SFsObjectIxRec*)User::ReAlloc(iObjects,newAlloc*sizeof(SFsObjectIxRec));
   496 				iObjects=(SFsObjectIxRec*)User::ReAlloc(iObjects,newAlloc*sizeof(SFsObjectIxRec));
       
   497 				__ASSERT_DEBUG(iObjects,User::Panic(_L("FS_LDR panic"),ELdrHeapCorruptionOnRemove));
       
   498 			    }
   493 			else
   499 			else
   494 				{
   500 				{
   495 				delete iObjects;
   501 				delete iObjects;
   496 				iObjects=NULL;
   502 				iObjects=NULL;
   497 				}
   503 				}
   677 			TInt newAlloc=--iCount;
   683 			TInt newAlloc=--iCount;
   678 			newAlloc=(newAlloc+(KObjectConGranularity-1))&~(KObjectConGranularity-1);
   684 			newAlloc=(newAlloc+(KObjectConGranularity-1))&~(KObjectConGranularity-1);
   679 			if (newAlloc!=iAllocated)
   685 			if (newAlloc!=iAllocated)
   680 				{
   686 				{
   681 				if (newAlloc)
   687 				if (newAlloc)
       
   688 				    {
   682 					iObjects=(CFsObject**)User::ReAlloc(iObjects,newAlloc*sizeof(CFsObject*));
   689 					iObjects=(CFsObject**)User::ReAlloc(iObjects,newAlloc*sizeof(CFsObject*));
       
   690 					__ASSERT_DEBUG(iObjects,User::Panic(_L("FS_LDR panic"),ELdrHeapCorruptionOnRemove));
       
   691 				    }
   683 				else
   692 				else
   684 					{
   693 					{
   685 					delete iObjects;
   694 					delete iObjects;
   686 					iObjects=NULL;
   695 					iObjects=NULL;
   687 					}
   696 					}