From: Benno Schulenberg Date: Sun, 21 Feb 2016 20:54:04 +0000 (+0000) Subject: Removing four unneeded checks for NULL. X-Git-Tag: v2.5.3~23 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=814a4220a21a4b168e9945a9da7744099977a0de;p=nano.git Removing four unneeded checks for NULL. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5657 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index b7e9914f..961aa996 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2016-02-21 Benno Schulenberg * src/files.c (input_tab): If the first Tab added the part that all matches have in common, don't require a third Tab to show the list. + * scr/global.c (thanks_for_all_the_fish): Remove unneeded checks. 2016-02-20 Benno Schulenberg * src/search.c (get_history_completion): Avoid leaking memory diff --git a/src/global.c b/src/global.c index 596ab541..1dfd35d9 100644 --- a/src/global.c +++ b/src/global.c @@ -1654,11 +1654,9 @@ void thanks_for_all_the_fish(void) #ifndef DISABLE_SPELLER free(alt_speller); #endif - if (cutbuffer != NULL) - free_filestruct(cutbuffer); + free_filestruct(cutbuffer); #ifndef DISABLE_JUSTIFY - if (jusbuffer != NULL) - free_filestruct(jusbuffer); + free_filestruct(jusbuffer); #endif /* Free the memory associated with each open file buffer. */ if (openfile != NULL) @@ -1724,17 +1722,16 @@ void thanks_for_all_the_fish(void) #endif /* !DISABLE_COLOR */ #ifndef DISABLE_HISTORIES /* Free the search and replace history lists. */ - if (searchage != NULL) - free_filestruct(searchage); - if (replaceage != NULL) - free_filestruct(replaceage); + free_filestruct(searchage); + free_filestruct(replaceage); #endif - /* Free the functions and shortcuts lists. */ + /* Free the list of functions. */ while (allfuncs != NULL) { subnfunc *f = allfuncs; allfuncs = allfuncs->next; free(f); } + /* Free the list of shortcuts. */ while (sclist != NULL) { sc *s = sclist; sclist = sclist->next;