func: void bad() char * data ; data = ( char * ) malloc ( 100 * sizeof ( char ) ); data [ 0 ] = '\0'; CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_84_bad * badObject = new CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_84_bad ( data ) ; CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_84_bad::CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_84_bad(char * dataCopy) data = dataCopy; size_t dataLen = strlen ( data ) ; FILE * pFile ; if ( 100 - dataLen > 1 )  pFile = fopen ( FILENAME , "r" ); if ( pFile != NULL )  if ( fgets ( data + dataLen , ( int ) ( 100 - dataLen ) , pFile ) == NULL )  printLine ( "fgets() failed" ); void printLine (const char * line) if ( line != NULL )  printf ( "%s\n" , line ); data [ dataLen ] = '\0'; fclose ( pFile ); delete badObject CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_84_bad::~CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_84_bad() for (; *data != '\0'; data++) if ( * data == SEARCH_CHAR )  printLine ( "We have a match!" ); void printLine (const char * line) if ( line != NULL )  printf ( "%s\n" , line ); break ; free ( data ); 