[Bug 547333] New: kvirc-3.4.2-3.39: two memory leaks
http://bugzilla.novell.com/show_bug.cgi?id=547333 Summary: kvirc-3.4.2-3.39: two memory leaks 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 kvirc-3.4.2-3.39 source code file kvirc-3.4.2/src/kvirc/kernel/kvi_app_setup.cpp 1. function KviApp::checkFileAssociations I notice the following code buffer = (char*)malloc(len*sizeof(char)); HKEY hKey; if(RegOpenKeyEx(HKEY_CLASSES_ROOT,".kvs",0,KEY_READ,&hKey) != ERROR_SUCCESS ) return false; If the return is taken, then buffer is a memory leak. Suggest new code HKEY hKey; if(RegOpenKeyEx(HKEY_CLASSES_ROOT,".kvs",0,KEY_READ,&hKey) != ERROR_SUCCESS ) return false; buffer = (char*)malloc(len*sizeof(char)); 2. More problem code buffer = (char*)malloc(len*sizeof(char)); HKEY hKey; KviStr storedKey = proto; KviStr key=storedKey; len = QUERY_BUFFER; if(RegOpenKeyEx(HKEY_CLASSES_ROOT,key,0,KEY_READ,&hKey) != ERROR_SUCCESS ) return false; Suggest new code HKEY hKey; KviStr storedKey = proto; KviStr key=storedKey; len = QUERY_BUFFER; if(RegOpenKeyEx(HKEY_CLASSES_ROOT,key,0,KEY_READ,&hKey) != ERROR_SUCCESS ) return false; buffer = (char*)malloc(len*sizeof(char)); -- 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=547333
Andreas Jaeger
http://bugzilla.novell.com/show_bug.cgi?id=547333
User rguenther@novell.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=547333#c1
--- Comment #1 from Richard Guenther
http://bugzilla.novell.com/show_bug.cgi?id=547333
User prusnak@novell.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=547333#c2
Pavol Rusnak
participants (1)
-
bugzilla_noreply@novell.com