Well I'm not sure if this is a memory leak or not. I'm pretty certain it is, but need the view of a more experienced programmer .
At first glance (to me at least) it looks like a memory leak because the buffer can apparently not be free'd.Code:// for example char* get_buffer() { char* buffer = malloc(20 * sizeof(char)); // etc return buffer; // memory leak? }
How would I get around this without the use of gloabal variables?