summaryrefslogtreecommitdiffstats
path: root/grammar/rainerscript.c
diff options
context:
space:
mode:
Diffstat (limited to 'grammar/rainerscript.c')
-rw-r--r--grammar/rainerscript.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c
index 320e66d0..66932c77 100644
--- a/grammar/rainerscript.c
+++ b/grammar/rainerscript.c
@@ -623,14 +623,13 @@ cnfactlstAddSysline(struct cnfactlst* actlst, char *line)
struct cnfcfsyslinelst *cflst;
if((cflst = malloc(sizeof(struct cnfcfsyslinelst))) != NULL) {
- cflst->next = NULL;
cflst->line = line;
if(actlst->syslines == NULL) {
- actlst->syslines = cflst;
+ cflst->next = NULL;
} else {
cflst->next = actlst->syslines;
- actlst->syslines = cflst;
}
+ actlst->syslines = cflst;
}
return actlst;
}
@@ -1410,6 +1409,9 @@ cnfrulePrint(struct cnfrule *rule)
dbgprintf("------ end rule %p\n", rule);
}
+/* note: the sysline itself was already freed during processing
+ * and as such MUST NOT be freed again!
+ */
void
cnfcfsyslinelstDestruct(struct cnfcfsyslinelst *cfslst)
{
@@ -1417,7 +1419,6 @@ cnfcfsyslinelstDestruct(struct cnfcfsyslinelst *cfslst)
while(cfslst != NULL) {
toDel = cfslst;
cfslst = cfslst->next;
- free(toDel->line);
free(toDel);
}
}