Share

Burstsort

Tracker: Bugs

5 Possible memory leak in the Burst - ID: 1740582
Last Update: Settings changed ( stefanwebb )

It isn't a big deal but I noticed in the burst method of the Burstsort
class if a node is created the old nodes bucket isn't cleaned up even
though it will only be used again as an integer. Attached is a patch which
I believe fixes the little leak in this method.


marq ( marquedios ) - 2007-06-20 20:39

5

Closed

None

Nobody/Anonymous

None

None

Public


Comment ( 1 )




Date: 2007-07-13 18:52
Sender: goewe


+
+ //keep the memory from leaking out, we should never need more than
4 byt
es for the pointer to the next node
+ free(trie.nodes[node].bucket);
+ trie.nodes[node].bucket = (char*) malloc(sizeof(char) * 4);
+

what about:
- trie.nodes[node].bucket = (char*) malloc(sizeof(char) * 4);
+ trie.nodes[node].bucket = (char*) malloc(sizeof(*char));

?




Log in to comment.

Attached File ( 1 )

Filename Description Download
Burstsort_burst-leak_prevention.diff Patch to help bits of memory from leaking. Download

Changes ( 3 )

Field Old Value Date By
status_id Open 2007-08-04 21:25 stefanwebb
close_date - 2007-08-04 21:25 stefanwebb
File Added 233953: Burstsort_burst-leak_prevention.diff 2007-06-20 20:39 marquedios