Bugs item #1844965, was opened at 2007-12-05 09:30
Message generated for change (Settings changed) made by shadowchaser
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=642714&aid=1844965&group_id=105970

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: extensions
>Group: v3.0
Status: Open
Resolution: None
>Priority: 7
Private: No
Submitted By: Eric Bickle (shadowchaser)
Assigned to: Scott Kurtzeborn (scotk)
Summary: String memory leaks in ExecServiceConfig

Initial Comment:
There appear to be a number of memory leaks in the ServiceConfig deferred 
custom action. (ScheldServiceConfig, ExecServiceConfig, and 
RollbackServiceConfig)

The memory leaks occur if there is more than one service being configured.

Looking at the code for WcaReadStringFromCaData (wcawrap.cpp(1060)), the 
function allocates a new string in to memory pointed to by ppwzString if it 
returns S_OK. The caller is responsible for calling ReleaseStr on the returned 
pointer if the function was successful.

The ServiceConfig custom action code, located in serviceconfig.cpp, iterates 
through each service being configured, allocating strings each time. Although 
the data is cleaned up in the exit block at the bottom of the function, the 
data is not released during each iteration. Memory leaks will occur if more 
than one service is configured during an install.

serviceconfig.cpp(61): New strings allocated in SchedServiceConfig's loop, but 
not released:
* pwzData @ line 111
* pwzData @ line 121
* pwzData @ line 131
* pwzData @ line 154
* pwzData @ line 159
(notice wcawrap.cpp(818), which allocates a string into ppwzData during the 
WcaGetRecordFormattedString call)

serviceconfig.cpp(275): New strings allocated in ExecServiceConfig's loop, but 
not released:
* pwzServiceName
* pwzFirstFailureActionType
* pwzSecondFailureActionType
* wzThirdFailureActionType
* pwzProgramCommandLine
* pwzRebootMessage

serviceconfig.cpp(438): New strings allocated in RollbackServiceConfig's loop, 
but not released:
* pwzServiceName,
* pwzFirstFailureActionType
* pwzSecondFailureActionType
* wzThirdFailureActionType
* pwzProgramCommandLine
* pwzRebootMessage

I may have missed some memory leaks, I would recommend a full code review of 
serviceconfig.cpp

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=642714&aid=1844965&group_id=105970

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
WiX-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-devs

Reply via email to