X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=progs%2Finfocmp.c;h=0c36c2de03a74c4d67017795a5c1355fc81da4fb;hp=84989ffc63d44cbff7e321feb7ba00d623f2b401;hb=cb9a015f6669e86dd5db0fcdf1a6d74c7ea5df55;hpb=49e6baa94900e73cfc440dcb54c4f2eeda462ad8 diff --git a/progs/infocmp.c b/progs/infocmp.c index 84989ffc..0c36c2de 100644 --- a/progs/infocmp.c +++ b/progs/infocmp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: infocmp.c,v 1.103 2008/08/16 22:04:56 tom Exp $") +MODULE_ID("$Id: infocmp.c,v 1.104 2009/12/05 21:10:31 tom Exp $") #define L_CURL "{" #define R_CURL "}" @@ -1255,6 +1255,15 @@ terminal_env(void) * ***************************************************************************/ +#if NO_LEAKS +#define MAIN_LEAKS() \ + free(myargv); \ + free(tfile); \ + free(tname) +#else +#define MAIN_LEAKS() /* nothing */ +#endif + int main(int argc, char *argv[]) { @@ -1514,6 +1523,7 @@ main(int argc, char *argv[]) #else (void) fprintf(stderr, "%s: terminfo files not supported\n", _nc_progname); + MAIN_LEAKS(); ExitProgram(EXIT_FAILURE); #endif } else { @@ -1534,6 +1544,7 @@ main(int argc, char *argv[]) "%s: couldn't open terminfo file %s.\n", _nc_progname, tfile[termcount]); + MAIN_LEAKS(); ExitProgram(EXIT_FAILURE); } repair_acsc(&entries[termcount].tterm); @@ -1642,11 +1653,7 @@ main(int argc, char *argv[]) else file_comparison(argc - optind, argv + optind); -#if NO_LEAKS - free(myargv); - free(tfile); - free(tname); -#endif + MAIN_LEAKS(); ExitProgram(EXIT_SUCCESS); }