BUG: Use of FPC.Arrays Property Causes Memory Leak (319355)



The information in this article applies to:

  • Microsoft Internet Security and Acceleration Server 2000
  • Microsoft Internet Security and Acceleration Server 2000 SP1

This article was previously published under Q319355

SYMPTOMS

When an Internet Security and Acceleration (ISA) server is a member of the array, if you use the FPC.Arrays property, a memory leak occurs.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

The following code sample demonstrates this problem.
#import "C:\\Program Files\Microsoft ISA Server\\msfpccom.dll"
#include <stdio.h>
void leak()
{
    HRESULT hr;
    hr = CoInitializeEx( 0, COINIT_MULTITHREADED ); 
    if (hr == S_OK)
    {         
        FPCLib::IFPCPtr sipFPCRoot;
        FPCLib::IFPCArraysPtr sipArrays;
        FPCLib::IFPCArrayPtr sipArrayObj;
        // Create the ISA root object.
        if ((hr = sipFPCRoot.CreateInstance("FPC.Root")) == S_OK)
        {   
            Sleep(3000);

            sipArrays = sipFPCRoot->Arrays; // leaks
            sipArrayObj = sipArrays->GetContainingArray();

            // The following equivalent calls leaks too.
            // sipArrayObj = sipFPCRoot->Arrays->GetContainingArray();
        }
    }

    CoUninitialize();
    return;
}

int main()
{
  while (true)
    leak();

  return 0;
}
				

REFERENCES

For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

136885 INFO: OLE Threads Must Dispatch Messages


Modification Type:MajorLast Reviewed:7/10/2002
Keywords:kbbug KB319355