/* CSE 333 Su12 Lecture 5 demo: leaky.c */
/* Gribble/Perkins */

/* What exactly happens when this program runs? */

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

void leak(int bytes) {
  char *buf = malloc(bytes);
  assert(buf != NULL);
}

int main(int argc, char **argv) {
  while(1) {
    leak(100000);
  }
}