func: void bad() int count ; count = - 1; CWE400_Resource_Exhaustion__fgets_fwrite_84_bad * badObject = new CWE400_Resource_Exhaustion__fgets_fwrite_84_bad ( count ) ; CWE400_Resource_Exhaustion__fgets_fwrite_84_bad::CWE400_Resource_Exhaustion__fgets_fwrite_84_bad(int countCopy) count = countCopy; char inputBuffer [ CHAR_ARRAY_SIZE ] = "" ; if ( fgets ( inputBuffer , CHAR_ARRAY_SIZE , stdin ) != NULL )  count = atoi ( inputBuffer ); printLine ( "fgets() failed." ); delete badObject CWE400_Resource_Exhaustion__fgets_fwrite_84_bad::~CWE400_Resource_Exhaustion__fgets_fwrite_84_bad() const char * filename = "output_bad.txt" ; pFile = fopen ( filename , "w+" ); if ( pFile )  fclose ( pFile ); 