]> git.wh0rd.org Git - nano.git/commitdiff
write_file(): Don't free() realname on write error
authorChris Allegretta <chrisa@asty.org>
Thu, 18 Jan 2001 15:04:20 +0000 (15:04 +0000)
committerChris Allegretta <chrisa@asty.org>
Thu, 18 Jan 2001 15:04:20 +0000 (15:04 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@490 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
files.c

index 4d81b74a99135ecd47a9af6a6ff5644e48fad3ef..e12a8a030d62cda572684d76274da39d582269b5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
 CVS code -
+- files.c:
+  write_file()
+       - Don't free() realname on error, if it needs to be free()d later
+         it will be (fixes crash on successful write after failed write,
+         discovered by David Sobon).
 
 nano 0.9.99-pre1 - 01/17/2001
 General
diff --git a/files.c b/files.c
index 8eef1e260b3ee2ddc34ed6f32557ea16cddf45f3..5d19a0b5e7e4ea1e902def8d30a6de1c49152180 100644 (file)
--- a/files.c
+++ b/files.c
@@ -378,7 +378,6 @@ int write_file(char *name, int tmp)
            }
            statusbar(_("Could not open file for writing: %s"),
                      strerror(errno));
-           free(realname);
            return -1;
        }