From 755b9d3016f4c30850d6533159b8dd3169e44b13 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 27 Oct 2005 19:36:30 +0000 Subject: fix use-after-free (#171198) --- src/initlog.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/initlog.c b/src/initlog.c index af75c7b1..66ac14ff 100644 --- a/src/initlog.c +++ b/src/initlog.c @@ -237,7 +237,10 @@ int logLine(struct logInfo *logEnt) { ) { DDEBUG("starting daemon failed, pooling entry %d\n",logEntries); logData=realloc(logData,(logEntries+1)*sizeof(struct logInfo)); - logData[logEntries]= (*logEnt); + logData[logEntries].fac = logEnt->fac; + logData[logEntries].pri = logEnt->pri; + logData[logEntries].cmd = strdup(logEnt->cmd); + logData[logEntries].line = strdup(logEnt->line); logEntries++; } else { if (logEntries>0) { -- cgit