From 32c659c8a7c88ec21c878c4778a1f2e1dca49b5f Mon Sep 17 00:00:00 2001 From: theStack Date: Thu, 24 Sep 2009 04:12:07 +0200 Subject: [PATCH] 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) --- main.c | 1 + 1 file changed, 1 insertion(+) 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); -- 2.25.1