On Wed, Aug 24, 2011 at 23:59, Chris London <ch...@kwista.com> wrote: > Hey everyone, > > I don't like to bother mailing lists with beginner questions so I spent > a few hours on Google looking for info and tutorials. I'm sure at least one > of you has had that experience :) Anyway, I have finished my first module > and it works exactly how I want it to. I still have more features I want to > add but I'm a little rusty with my C and even worse at Apache Modules. Would > you mind taking a glance at my code to see if I'm doing anything wrong or > have any memory leaks or anything? > > Here's the source code: > https://github.com/chrislondon/Dynamic-Stylesheets/blob/master/mod_dss.c > > Feel free to fork my project: > https://github.com/chrislondon/Dynamic-Stylesheets > > The README file ( > https://github.com/chrislondon/Dynamic-Stylesheets/blob/master/README) > contains > usage info and the project contains a simple test case. > > Thanks everyone!
You open the file but then you exit the handler if r->header_only without closing the file. Check for r->header_only before opening the file. In T_read you allocate cKey, cVal, and temp_node once for every iteration of the outermost while loop in which *cCurrent == '@' , but you free this memory only once, outside the while loop. Also, you do not free correctly your linked list. S