Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » UppHub » [BUG] Heap leak in SysExec package
[BUG] Heap leak in SysExec package [message #41833] Mon, 27 January 2014 18:36 Go to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
Hi,

there is a heap leak in SysExec.cpp originating from not freeing argv and envv pointers at the end of SysExec function.

In addition I propose to introduce a flag DELETE_TMP_FILES or something similar to delete created tmp files when SysExec finishes. The reason for this request is that I have a programm that repeatedly calls SysExec and therefore the directory containing tmp files ends up unnecessarily containing a lot of them.

The proposed patch is attached.

[edit] Wherever BuildArgs or BuildEnv are called the pointers need to be freed e.g., also in SudoLib.cpp.

Regards
Matthias

[Updated on: Mon, 27 January 2014 20:37]

Report message to a moderator

Re: [BUG] Heap leak in SysExec package [message #41893 is a reply to message #41833] Tue, 04 February 2014 08:58 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1285
Registered: September 2007
Senior Contributor
Hi Masu,

I'll check your patch on next days.
Did you test it deeply ? I'm not sure if it's correct to free the pointers on caller's side.... I'm not sure if a copy is made by the call for SysExecXXX functions that don't wait for command completion.

Ciao

Max
Re: [BUG] Heap leak in SysExec package [message #42522 is a reply to message #41893] Thu, 20 March 2014 22:19 Go to previous message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
Hi Max,

sorry for replying that late.

Yes, my patch is not right if you use it without waiting for command completion.

I will try to think of a solution (hopefully this time it will not last that long Smile ).

Regards
Matthias
Previous Topic: FTGL_Demo WantFocus();
Next Topic: PieChart: Title disable
Goto Forum:
  


Current Time: Thu Oct 21 07:46:07 CEST 2021

Total time taken to generate the page: 0.02012 seconds