text: /* TEMPLATE GENERATED TESTCASE FILE
  Filename: CWE416_Use_After_Free__new_delete_struct_53b.cpp
  Label Definition File: CWE416_Use_After_Free__new_delete.label.xml
  Template File: sources-sinks-53b.tmpl.cpp
  */
  /*
   * @description
   * CWE: 416 Use After Free
   * BadSource:  Allocate data using new, initialize memory block, and Deallocate data using delete
   * GoodSource: Allocate data using new and initialize memory block
   * Sinks:
   *    GoodSink: Do nothing
   *    BadSink : Use data after free()
   * Flow Variant: 53 Data flow: data passed as an argument from one function through two others to a fourth; all four functions are in different source files
   *
   * */
  
  #include "std_testcase.h"
  
  #include <wchar.h>
  
  namespace CWE416_Use_After_Free__new_delete_struct_53
  {
  
  #ifndef OMITBAD
  
  /* bad function declaration */
  void bad_sink_c(twoints * data);
  
  void bad_sink_b(twoints * data)
  {
      bad_sink_c(data);
  }
  
  #endif /* OMITBAD */
  
  #ifndef OMITGOOD
  
  /* goodG2B uses the GoodSource with the BadSink */
  void goodG2B_sink_c(twoints * data);
  
  void goodG2B_sink_b(twoints * data)
  {
      goodG2B_sink_c(data);
  }
  
  /* goodB2G uses the BadSource with the GoodSink */
  void goodB2G_sink_c(twoints * data);
  
  void goodB2G_sink_b(twoints * data)
  {
      goodB2G_sink_c(data);
  }
  
  #endif /* OMITGOOD */
  
  } // close namespace
  