Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
843 B

  1. #include "headers.hxx"
  2. HINSTANCE hResourceModuleHandle = 0;
  3. const wchar_t* RUNTIME_NAME = L"coretest";
  4. DWORD DEFAULT_LOGGING_OPTIONS = Burnslib::Log::OUTPUT_TYPICAL;
  5. // set the HeapFlags to trace allocations to see the leak detection
  6. void
  7. f3()
  8. {
  9. LOG_FUNCTION(f3);
  10. int* leak4 = new int[2];
  11. leak4[0] = 1;
  12. }
  13. void
  14. f2()
  15. {
  16. LOG_FUNCTION2(f2, L"this is f2");
  17. String* leak3 = new String;
  18. *leak3 = L"jello";
  19. f3();
  20. }
  21. void
  22. f1()
  23. {
  24. LOG_FUNCTION(f1);
  25. char* leak1 = new char[100];
  26. leak1[0] = 'S';
  27. f2();
  28. char* leak2 = new char[45];
  29. leak2[0] = 'B';
  30. }
  31. VOID
  32. _cdecl
  33. main(int, char **)
  34. {
  35. LOG_FUNCTION(main);
  36. LOG(L"Let the leaks begin");
  37. f1();
  38. wchar_t* leak5 = new wchar_t;
  39. *leak5 = L'X';
  40. LOG(L"now ending main");
  41. }