hellomotor / crashrpt

Automatically exported from code.google.com/p/crashrpt
0 stars 0 forks source link

Resource leak in CrashRpt #160

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

What steps will reproduce the problem?
1. Initialize CrashRpt with a call to crInstall with the flag 
CR_INST_SEND_QUEUED_REPORTS set.
2. Run your app and wait for crInstall to finish.
3. Using a tool like RamMap (SysInternals) you'll see that CrashSender.exe 
remains in the Process list.

What is the expected output? What do you see instead?

I'd expect CrashSender.exe to not be in the list, it doesn't appear in other 
programs like ProcessExplorer.

What version of CrashRpt are you using?
1300

What is your version of Visual Studio?
VS 2010

What is your version of Windows operating system?
Win7 x64

Please provide any additional information below.

The handle to the process is not closed in LaunchCrashSender. Since it's 
possible that the caller WANTS the CrashSender process handle it should only be 
closed if the caller passes phProcess==NULL, e.g. code should be like this:

Line 1282:
    // Return handle to the CrashSender.exe process.
    if(phProcess!=NULL)
    {
        *phProcess = pi.hProcess;
    }
    else
    {
        // Handle not required by caller so close it.

        CloseHandle( pi.hProcess );
        pi.hProcess = NULL;
    }

Patch:

1287a1288,1294
>   else
>   {
>       // Handle not required by caller so close it.
> 
>       CloseHandle( pi.hProcess );
>       pi.hProcess = NULL;
>   }

Original issue reported on code.google.com by mythics...@gmail.com on 20 Jul 2012 at 11:55

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1351.

Original comment by zexspect...@gmail.com on 26 Aug 2012 at 4:09