diff options
Diffstat (limited to 'usr.bin/calendar')
-rw-r--r-- | usr.bin/calendar/io.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c index 2b1a26f..ef98d5d 100644 --- a/usr.bin/calendar/io.c +++ b/usr.bin/calendar/io.c @@ -107,8 +107,10 @@ cal(void) tm.tm_wday = 0; count = 0; - if ((fp = opencal()) == NULL) + if ((fp = opencal()) == NULL) { + free(extradata); return; + } while (fgets(buf, sizeof(buf), stdin) != NULL) { if ((pp = strchr(buf, '\n')) != NULL) *pp = '\0'; @@ -203,6 +205,7 @@ cal(void) event_print_all(fp); closecal(fp); + free(extradata); } FILE * |