text: /* TEMPLATE GENERATED TESTCASE FILE
  Filename: CWE590_Free_Memory_Not_on_Heap__free_struct_static_51b.c
  Label Definition File: CWE590_Free_Memory_Not_on_Heap__free.label.xml
  Template File: sources-sink-51b.tmpl.c
  */
  /*
   * @description
   * CWE: 590 Free Memory Not on Heap
   * BadSource: static Data buffer is declared static on the stack
   * GoodSource: Allocate memory on the heap
   * Sink:
   *    BadSink : Print then free data
   * Flow Variant: 51 Data flow: data passed as an argument from one function to another in different source files
   *
   * */
  
  #include "std_testcase.h"
  
  #include <wchar.h>
  
  /* all the sinks are the same, we just want to know where the hit originated if a tool flags one */
  
  #ifndef OMITBAD
  
  void CWE590_Free_Memory_Not_on_Heap__free_struct_static_51b_badSink(twoIntsStruct * data)
  {
      printStructLine(&data[0]);
      /* POTENTIAL FLAW: Possibly deallocating memory allocated on the stack */
      free(data);
  }
  
  #endif /* OMITBAD */
  
  #ifndef OMITGOOD
  
  /* goodG2B uses the GoodSource with the BadSink */
  void CWE590_Free_Memory_Not_on_Heap__free_struct_static_51b_goodG2BSink(twoIntsStruct * data)
  {
      printStructLine(&data[0]);
      /* POTENTIAL FLAW: Possibly deallocating memory allocated on the stack */
      free(data);
  }
  
  #endif /* OMITGOOD */
  