From 544347c08a536916d88fd9ae4056c0975ec75bf4 Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Fri, 5 Jan 2001 14:31:52 +0000 Subject: [PATCH] Oops, stop freeing stuff we can't necessarily free git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@449 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- files.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/files.c b/files.c index a2a5f7f1..8846ffae 100644 --- a/files.c +++ b/files.c @@ -276,10 +276,10 @@ int do_insertfile(void) char *tmp = do_browser(getcwd(NULL, 0)); #ifdef DISABLE_TABCOMP - free(realname); + realname = NULL; #endif if (tmp != NULL) - realname = tmp; + realname = mallocstrcpy(realname, tmp); else return do_insertfile(); } @@ -528,10 +528,8 @@ int do_writeout(int exiting) if (i == NANO_TOFILES_KEY) { char *tmp = do_browser(getcwd(NULL, 0)); - if (tmp != NULL) { - free(answer); - answer = tmp; - } + if (tmp != NULL) + answer = mallocstrcpy(answer, tmp); else return do_writeout(exiting); } -- 2.39.5