# HG changeset patch # User Szymon Wilczek # Date 1230984020 0 # Node ID 8789e4b0e0e7c0e5f39b2340bb9258d1f47a4914 # Parent d578ae900755053e9ab77868f454cefd4258d461 Bug 653 bugfix diff -r d578ae900755 -r 8789e4b0e0e7 src/video/win32/SDL_win32mouse.c --- a/src/video/win32/SDL_win32mouse.c Sat Jan 03 07:33:42 2009 +0000 +++ b/src/video/win32/SDL_win32mouse.c Sat Jan 03 12:00:20 2009 +0000 @@ -85,7 +85,7 @@ continue; } buffer = SDL_malloc((tmp + 1) * sizeof(char)); - key_name = SDL_malloc(tmp + sizeof(reg_key_root) * sizeof(char)); + key_name = SDL_malloc((tmp + SDL_strlen(reg_key_root) + 1) * sizeof(char)); /* we're getting the device registry path and polishing it to get it's name, surely there must be an easier way, but we haven't found it yet */ @@ -125,6 +125,9 @@ } } } + + buffer -= 4; + if (is_rdp == 1) { SDL_free(buffer); SDL_free(key_name);