Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

malloc() and free()

Name: Anonymous 2011-01-18 22:44

#include <stdlib.h>

int * b;

int main(void)
{
    int * a = NULL;
    a = (int *) malloc(sizeof(int));
    b = &a;
    free(b);
    return 0;
}


Would this result in a memory leak? If yes, why?

Name: Anonymous 2011-01-22 20:12

I'm just being cute and tsundere. Here you are. Now please remember the frightening power of cache, and try to stay on its good side.
http://pastebin.com/3cVBAqhK
http://pastebin.com/AJSYYC65

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List