summaryrefslogtreecommitdiff
path: root/lib/vty.c
diff options
context:
space:
mode:
authorgdt <gdt>2003-12-22 20:18:18 +0000
committergdt <gdt>2003-12-22 20:18:18 +0000
commit3dbf99698a3be2e920871c3127ea089e061a127c (patch)
tree8652a4b960116adc4cade4652729474ced8e5ba9 /lib/vty.c
parentaa593d5e2638566ead1e69381e60639550991ff2 (diff)
Reorder free(f); unlink(f); to unlink before freeing.
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 8ba99708..6063290c 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2173,9 +2173,9 @@ vty_use_backup_config (char *fullpath)
sav = open (fullpath_sav, O_RDONLY);
if (sav < 0)
{
+ unlink (fullpath_tmp);
free (fullpath_sav);
free (fullpath_tmp);
- unlink (fullpath_tmp);
return NULL;
}
@@ -2187,9 +2187,9 @@ vty_use_backup_config (char *fullpath)
if (chmod(fullpath_tmp, CONFIGFILE_MASK) != 0)
{
+ unlink (fullpath_tmp);
free (fullpath_sav);
free (fullpath_tmp);
- unlink (fullpath_tmp);
return NULL;
}