From: Florian Krohm Date: Wed, 28 Sep 2011 17:43:44 +0000 (+0000) Subject: Fix a NULL pointer dereference issue spotted by IBM's BEAM checker. X-Git-Tag: svn/VALGRIND_3_7_0~175 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e43c5d7862838b2800db34aca44af2156edc786;p=thirdparty%2Fvalgrind.git Fix a NULL pointer dereference issue spotted by IBM's BEAM checker. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12062 --- diff --git a/cachegrind/cg_merge.c b/cachegrind/cg_merge.c index 94cc347f12..7917627ccc 100644 --- a/cachegrind/cg_merge.c +++ b/cachegrind/cg_merge.c @@ -937,7 +937,7 @@ int main ( int argc, char** argv ) show_CacheProfFile( outfile, cpf ); if (ferror(outfile)) { fprintf(stderr, "%s: error writing output file %s\n", - argv0, outfilename); + argv0, outfilename ? outfilename : "(stdout)" ); perror(argv0); if (outfile != stdout) fclose(outfile);