aboutsummaryrefslogtreecommitdiffstats
path: root/src/initlog.c
diff options
context:
space:
mode:
authorDan Walsh <dwalsh@redhat.com>2005-07-21 19:37:20 +0000
committerDan Walsh <dwalsh@redhat.com>2005-07-21 19:37:20 +0000
commitd9b962a611a729fb322fc255b18bb22f30acf7f9 (patch)
tree09961ec5a97f71e563001da9bf367df1abdbb9f5 /src/initlog.c
parent8e99d23baba6921317b488eb2b654713ee3e2b36 (diff)
downloadinitscripts-d9b962a611a729fb322fc255b18bb22f30acf7f9.tar
initscripts-d9b962a611a729fb322fc255b18bb22f30acf7f9.tar.gz
initscripts-d9b962a611a729fb322fc255b18bb22f30acf7f9.tar.bz2
initscripts-d9b962a611a729fb322fc255b18bb22f30acf7f9.tar.xz
initscripts-d9b962a611a729fb322fc255b18bb22f30acf7f9.zip
fix glibc free error
Diffstat (limited to 'src/initlog.c')
-rw-r--r--src/initlog.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/initlog.c b/src/initlog.c
index 515c3c73..74f1a1f1 100644
--- a/src/initlog.c
+++ b/src/initlog.c
@@ -250,11 +250,12 @@ int logEvent(char *cmd, int eventtype,char *string) {
struct logInfo logentry;
if (cmd) {
- logentry.cmd = strdup(basename(cmd));
+ logentry.cmd = basename(cmd);
if ((logentry.cmd[0] =='K' || logentry.cmd[0] == 'S') &&
( logentry.cmd[1] >= '0' && logentry.cmd[1] <= '9' ) &&
( logentry.cmd[2] >= '0' && logentry.cmd[2] <= '9' ) )
logentry.cmd+=3;
+ logentry.cmd = strdup(logentry.cmd);
} else
logentry.cmd = strdup(_("(none)"));
if (!string) {
@@ -283,11 +284,12 @@ int logString(char *cmd, char *string) {
int rc;
if (cmd) {
- logentry.cmd = strdup(basename(cmd));
+ logentry.cmd = basename(cmd);
if ((logentry.cmd[0] =='K' || logentry.cmd[0] == 'S') &&
( logentry.cmd[1] >= '0' && logentry.cmd[1] <= 0x39 ) &&
( logentry.cmd[2] >= '0' && logentry.cmd[2] <= 0x39 ) )
logentry.cmd+=3;
+ logentry.cmd = strdup(logentry.cmd);
} else
logentry.cmd = strdup(_(""));
logentry.line = strdup(string);