The use-after-frees are quite trivial to fix
diff --git a/ttyclock.c b/ttyclock.c index bd0c478..a626f13 100644 --- a/ttyclock.c +++ b/ttyclock.c @@ -461,14 +461,14 @@ main(int argc, char **argv) break; case 'i': puts("TTY-Clock 2 © by Martin Duquesnoy (xor...@gmail.com)"); - free(ttyclock); free(ttyclock->option.format); + free(ttyclock); exit(EXIT_SUCCESS); break; case 'v': puts("TTY-Clock 2 © devel version"); - free(ttyclock); free(ttyclock->option.format); + free(ttyclock); exit(EXIT_SUCCESS); break; case 's': @@ -510,8 +510,8 @@ main(int argc, char **argv) key_event(); } - free(ttyclock); free(ttyclock->option.format); + free(ttyclock); endwin(); return 0;
But running the program under valgrind suggests quite a few memory access problems remain.
FWIW, I couldn't duplicate the abort on Linux. d