- Memory leak fixes for files.c:do_insertfile(),do_browser(), nano.c:do_spell(), and search.c:do_replace() (David Benbennick)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1449 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
родитель
a4a9d1759f
Коммит
fdcb9e92d6
@ -11,6 +11,8 @@ CVS code
|
|||||||
(David Benbennick).
|
(David Benbennick).
|
||||||
- Change ngettext macro to P_(), to avoid a clash with the reserved C
|
- Change ngettext macro to P_(), to avoid a clash with the reserved C
|
||||||
__ identifier (Jordi).
|
__ identifier (Jordi).
|
||||||
|
- Memory leak fixes for files.c:do_insertfile(),do_browser(),
|
||||||
|
nano.c:do_spell(), and search.c:do_replace() (David Benbennick).
|
||||||
- files.c:
|
- files.c:
|
||||||
cwd_tab_completion()
|
cwd_tab_completion()
|
||||||
- Memory leak fix (David Benbennick).
|
- Memory leak fix (David Benbennick).
|
||||||
|
7
files.c
7
files.c
@ -503,9 +503,10 @@ int do_insertfile(int loading_file)
|
|||||||
if (i == NANO_TOFILES_KEY) {
|
if (i == NANO_TOFILES_KEY) {
|
||||||
char *tmp = do_browse_from(answer);
|
char *tmp = do_browse_from(answer);
|
||||||
|
|
||||||
if (tmp != NULL)
|
if (tmp != NULL) {
|
||||||
|
free(answer);
|
||||||
answer = tmp;
|
answer = tmp;
|
||||||
else
|
} else
|
||||||
goto start_again;
|
goto start_again;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -2718,6 +2719,8 @@ char *do_browser(const char *inpath)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Start over again with the new path value */
|
/* Start over again with the new path value */
|
||||||
|
free_charptrarray(filelist, numents);
|
||||||
|
free(foo);
|
||||||
free(path);
|
free(path);
|
||||||
path = new_path;
|
path = new_path;
|
||||||
return do_browser(path);
|
return do_browser(path);
|
||||||
|
12
nano.c
12
nano.c
@ -1976,7 +1976,7 @@ int do_spell(void)
|
|||||||
nano_disabled_msg();
|
nano_disabled_msg();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#else
|
#else
|
||||||
char *temp, *spell_msg = _("Generic error");
|
char *temp, *spell_msg;
|
||||||
|
|
||||||
if ((temp = safe_tempnam(0, "nano.")) == NULL) {
|
if ((temp = safe_tempnam(0, "nano.")) == NULL) {
|
||||||
statusbar(_("Could not create a temporary filename: %s"),
|
statusbar(_("Could not create a temporary filename: %s"),
|
||||||
@ -2001,17 +2001,15 @@ int do_spell(void)
|
|||||||
else
|
else
|
||||||
spell_msg = do_int_speller(temp);
|
spell_msg = do_int_speller(temp);
|
||||||
remove(temp);
|
remove(temp);
|
||||||
|
free(temp);
|
||||||
|
|
||||||
if (spell_msg == NULL) {
|
if (spell_msg != NULL) {
|
||||||
statusbar(_("Finished checking spelling"));
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
statusbar(_("Spell checking failed: %s"), spell_msg);
|
statusbar(_("Spell checking failed: %s"), spell_msg);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(temp);
|
statusbar(_("Finished checking spelling"));
|
||||||
|
return 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
search.c
1
search.c
@ -763,6 +763,7 @@ int do_replace(void)
|
|||||||
else
|
else
|
||||||
not_found_msg(prevanswer);
|
not_found_msg(prevanswer);
|
||||||
|
|
||||||
|
free(prevanswer);
|
||||||
replace_abort();
|
replace_abort();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user