View Issue Details

IDProjectCategoryView StatusLast Update
0001214unrealircdpublic2003-11-20 19:43
ReporterAngryWolf Assigned Tosyzop  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version3.2-beta17 
Summary0001214: Memory leak in _conf_ban()
DescriptionIn s_conf.c in _conf_ban(), memory is allocated for ca, but if a module sets up a hook for CONFIG_BAN (HOOKTYPE_CONFIG_RUN), ca is never freed up (due to a "return 0;").
Attached Files
ban_test.c (2,702 bytes)
3rd party modules

Activities

syzop

2003-08-29 01:33

administrator   ~0003531

Yeah but you should set up 2 hooks, one for config run and one for config test... this only happends if there's a hook for HOOKTYPE_CONFIGTEST and not for HOOKTYPE_CONFIG_RUN, right? The testing takes place @test, and then everything is assumed to be correct so almost no error checking is done @run.

AngryWolf

2003-08-29 04:39

reporter   ~0003532

No, I have both hooks, and my new ban block keeps eating my memory. Should I send you an example? Uploaded ban_test.c

syzop

2003-08-29 13:43

administrator   ~0003535

(confirmed)

Oh I thought you ment it allocs but if the module doesn't use it, it just returns instead of freeing, but it's rather "it allocs and should always free it when it reaches that else { } thing where modules are checked", I thought 'ca' was passed :p...

AngryWolf

2003-08-29 19:16

reporter   ~0003538

Yeah, passing that 'ca' somehow to the config run function could be useful for module coders, because you didn't have to use a separate ConfigItem_ban structure list; and it came up in my mind when reported this bug, however I thought you doesn't agree with this. It's good to see it's not precisely so :)

syzop

2003-08-31 18:36

administrator   ~0003557

Fixed in .1891 (added a free()).

Issue History

Date Modified Username Field Change
2003-08-28 08:07 AngryWolf New Issue
2003-08-29 01:33 syzop Note Added: 0003531
2003-08-29 04:39 AngryWolf File Added: ban_test.c
2003-08-29 04:39 AngryWolf Note Added: 0003532
2003-08-29 13:43 syzop Note Added: 0003535
2003-08-29 19:16 AngryWolf Note Added: 0003538
2003-08-31 18:36 syzop Status new => resolved
2003-08-31 18:36 syzop Resolution open => fixed
2003-08-31 18:36 syzop Assigned To => syzop
2003-08-31 18:36 syzop Note Added: 0003557
2003-11-20 19:43 syzop Status resolved => closed