Summary: | bad output for filename in slonik echo output | ||
---|---|---|---|
Product: | Slony-I | Reporter: | Steve Singer <ssinger> |
Component: | slonik | Assignee: | Slony Bugs List <slony1-bugs> |
Status: | NEW --- | ||
Severity: | enhancement | CC: | slony1-bugs |
Priority: | low | ||
Version: | 2.0 | ||
Hardware: | PC | ||
OS: | Linux |
Description
Steve Singer
2011-09-28 08:22:31 UTC
I *THINK the problem here is that in scan.l when processing an include directive we strdup() the filename and pass this to pushBuffer(). This sets current_file to the memory allocated by strdup. As the parser runs it stores a pointer to current_file into the structures that the parser creates. When processing of that file ends popBuffer() calls free(current_file). This will deallocate the memory even though the structures created by the parser still might point at that memory. In parser.y should we be calling strdup(current_file) to create a new copy of the filename for storing in the parser structures? |