summaryrefslogtreecommitdiffstats
path: root/lib/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/command.c')
-rw-r--r--lib/command.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/command.c b/lib/command.c
index 1df58f13..b035d272 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -3409,8 +3409,10 @@ DEFUN (banner_motd_file,
"Banner from a file\n"
"Filename\n")
{
- if (host.motdfile) free(host.motdfile);
- host.motdfile = strdup(argv[0]);
+ if (host.motdfile)
+ XFREE (MTYPE_TMP, host.motdfile);
+ host.motdfile = XSTRDUP (MTYPE_TMP, argv[0]);
+
return CMD_SUCCESS;
}