#include <iostream>

class Base {
 public:
  Base()  { std::cout << "Base()"  << std::endl; x = new int; }
  ~Base() { std::cout << "~Base()" << std::endl; delete x; }
  int* x;
};

class Der1 : public Base {
 public:
  Der1()  { std::cout << "Der1()"  << std::endl; y = new int; }
  ~Der1() { std::cout << "~Der1()" << std::endl; delete y; }
  int* y;
};

int main(int argc, char** argv) {
  Base* b0ptr = new Base;
  Base* b1ptr = new Der1;

  delete b0ptr;  // OK
  delete b1ptr;  // leaks Der1::y

  return 0;
}