From: theStack Date: Thu, 24 Sep 2009 02:12:07 +0000 (+0200) Subject: fixed memory leak (in a few h memory would be full) X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=ppcskel.git;a=commitdiff_plain;h=32c659c8a7c88ec21c878c4778a1f2e1dca49b5f fixed memory leak (in a few h memory would be full) better solution in this case: let not return usb_hidkb_getChars() newly allocated structure, but instead the user should provide memory for the structure and let him pass a pointer to that structure to the function (but i didn't want to change the interface so far) --- diff --git a/main.c b/main.c index 13524d5..6c30ab6 100644 --- a/main.c +++ b/main.c @@ -189,6 +189,7 @@ int main(void) y = STDOUT_BORDER_TOP; } } + free(k); if(j > 0) { /* when there was any printable stuff, show it */ print_str_noscroll(old_x, old_y, str); printf("y: %d\n", y);