Reorder free(f); unlink(f); to unlink before freeing.
diff --git a/lib/vty.c b/lib/vty.c
index 8ba9970..6063290 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2173,9 +2173,9 @@
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 @@
if (chmod(fullpath_tmp, CONFIGFILE_MASK) != 0)
{
+ unlink (fullpath_tmp);
free (fullpath_sav);
free (fullpath_tmp);
- unlink (fullpath_tmp);
return NULL;
}