[Bug 546037] New: bochs-2.2.1-256.19: memory leak
http://bugzilla.novell.com/show_bug.cgi?id=546037 Summary: bochs-2.2.1-256.19: memory leak Classification: openSUSE Product: openSUSE 11.2 Version: Factory Platform: All OS/Version: openSUSE 11.1 Status: NEW Severity: Normal Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: dcb314@hotmail.com QAContact: qa@suse.de Found By: --- I just had a look at factory package bochs-2.2.1-256.19 source code file bochs-2.2.1/gui/sdl.cc function bx_sdl_gui_c::create_bitmap local variable is tmp. I notice the following code bitmaps *tmp = new bitmaps; Uint32 *buf, *buf_row; Uint32 disp; unsigned char pixels; if (n_sdl_bitmaps >= MAX_SDL_BITMAPS) { BX_PANIC (("too many SDL bitmaps. To fix, increase MAX_SDL_BITMAPS")); return 0; } so if the if is true, then the return is taken and tmp has not been deleted, which causes a memory leak. Suggest new code bitmaps *tmp; Uint32 *buf, *buf_row; Uint32 disp; unsigned char pixels; if (n_sdl_bitmaps >= MAX_SDL_BITMAPS) { BX_PANIC (("too many SDL bitmaps. To fix, increase MAX_SDL_BITMAPS")); return 0; } tmp = new bitmaps; Of course, better code would not have fixed compile time limits like MAX_SDL_BITMAPS. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=546037
Andreas Jaeger
http://bugzilla.novell.com/show_bug.cgi?id=546037
User rguenther@novell.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=546037#c1
--- Comment #1 from Richard Guenther
http://bugzilla.novell.com/show_bug.cgi?id=546037
User prusnak@novell.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=546037#c2
Pavol Rusnak
participants (1)
-
bugzilla_noreply@novell.com