X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch.c;h=cfb009ba5036eeff5235dc4b792d4bbeb2133f5f;hp=a674481fe497059ddc43b581bc41e9165da94877;hb=d037040997f0dc38467f51e2cd89a558a72acd2a;hpb=8fc5f3b666dda07f21a1cca49c1bca2d72c5d77e diff --git a/notmuch.c b/notmuch.c index a674481f..cfb009ba 100644 --- a/notmuch.c +++ b/notmuch.c @@ -294,10 +294,6 @@ main (int argc, char *argv[]) ret = (command->function)(local, argc - opt_index, argv + opt_index); - /* in the future support for this environment variable may - * be supplemented or replaced by command line arguments - * --leak-report and/or --leak-report-full */ - talloc_report = getenv ("NOTMUCH_TALLOC_REPORT"); /* this relies on the previous call to @@ -305,7 +301,13 @@ main (int argc, char *argv[]) if (talloc_report && strcmp (talloc_report, "") != 0) { FILE *report = fopen (talloc_report, "w"); - talloc_report_full (NULL, report); + if (report) { + talloc_report_full (NULL, report); + } else { + ret = 1; + fprintf (stderr, "ERROR: unable to write talloc log. "); + perror (talloc_report); + } } return ret;