Create a gist now

Instantly share code, notes, and snippets.

@Raynos /leak.c
Created Jan 17, 2012

int some_method() {
SOME_STRUCT* reallyBigObject = malloc(sizeof(SOME_STRUCT));
// FORGET TO DEREFERENCE reallyBigObject
return 42;
}
var trolls = (function () {
var reallyBigObject = eatMemory();
(function () {
var lulz = reallyBigObject;
})();
// FORGET TO DEREFERENCE reallyBigObject
return function () {
return 42;
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment