diff --git a/src/global.c b/src/global.c
index 9a5585e4ff825678336a2dfacb718258eb2cd53c..3de904ff1079a2ee88e16f52eaf73ca13d92253d 100644
--- a/src/global.c
+++ b/src/global.c
@@ -1683,7 +1683,7 @@ void thanks_for_all_the_fish(void)
 	free(bill);
     }
 #endif /* !DISABLE_COLOR */
-#ifndef NANO_TINY
+#ifndef DISABLE_HISTORIES
     /* Free the search and replace history lists. */
     if (searchage != NULL)
 	free_filestruct(searchage);