View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0023281 | Community | OCCT:Visualization | public | 2012-07-13 19:01 | 2013-04-29 15:21 |
Reporter | Pawel | Assigned To | Pawel | ||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Platform | A | OS | L | ||
Product Version | 6.5.3 | ||||
Target Version | 6.6.0 | Fixed in Version | 6.6.0 | ||
Summary | 0023281: Memory leak / verification of one variable ommitted in OpenGL_ImageBox.cxx | ||||
Description | In the line 347 the variable 'abuf' is not checked against NULL. In the next line, if the method returns any previously allocated memory is not freed. It is necessary to call delete on each of the verified variables (C++ makes it safe to call delete even on NULL-variables.) and to clean up using'ImageClose'. | ||||
Tags | No tags attached. | ||||
Test case number | Not needed | ||||
|
Corresponding git branch pushed. Please review. |
|
OpenGl_ImageBox.cxx, > base = new unsigned[image->xsize*image->ysize]; > rbuf = new unsigned char[image->xsize]; > gbuf = new unsigned char[image->xsize]; > bbuf = new unsigned char[image->xsize]; > abuf = new unsigned char[image->xsize]; > if(!base || !rbuf || !gbuf || !bbuf || !abuf) > { > ImageClose(image); > delete [] base; > delete [] rbuf; > delete [] gbuf; > delete [] bbuf; > delete [] abuf; > return NULL; > } These NULL-checks are meaningless according to C++ rules. Allocations should be performed with exception-free methods (malloc etc.) or these checks should be entirely removed. Please also avoid tabulation symbols in patches. |
|
Dear kgv, as 'mallocs' were removed in one of the previous versions I left the 'new - delete' combination. Exception handling instead of NULL-checks implemented. Tabulations removed. Corresponding git branch pushed/updated. Please review. |
|
Please refer to the added note. |
|
Dear kgv, I'm not sure if you got the notification about the changes I've made (not sure if Mantis notified you) that's why I 'request feedback'. |
|
Dear san, please review the patch. OpenGl_ImageBox seems to be unused in current TKOpenGl at all. Updated patch is pushed to CR23281_2 branch. |
|
Branch СR23281_2 reviewed without remarks, ready for testing. Dear kgv, Could you please put some comment in this issue regarding removal of GetTexture*() functions from OpenGl_TextureBox.hxx/.cxx? |
|
>Could you please put some comment in this issue >regarding removal of GetTexture*() functions from OpenGl_TextureBox.hxx/.cxx? GetTexture() function implements reading of texture from file using read_texture from OpenGl_ImageBox. read_texture() read uncompressed data from file with some header - this is difficult to understand is this format is well-known or custom one due to lack of documentation. Anyway this functionality is not used by OpenGl_GraphicDriver. Instead GetTextureData() is used which create texture from already read/decoded image. |
|
Dear BugMaster, Branch СR23281_2 (and products from GIT master) was compiled on Linux and Windows platforms and tested. Regression: Not detected Improvements: Not detected Testing case: Not needed |
occt: master 43c34303 2012-10-18 16:44:39 Committer: Pawel Details Diff |
0023281: Removed unused OpenGl_ImageBox |
Affected Issues 0023281 |
|
mod - src/Image/Image_Color.hxx | Diff File | ||
mod - src/OpenGl/FILES | Diff File | ||
rm - src/OpenGl/OpenGl_ImageBox.cxx | Diff File | ||
rm - src/OpenGl/OpenGl_ImageBox.hxx | Diff File | ||
mod - src/OpenGl/OpenGl_TextureBox.cxx | Diff File | ||
mod - src/OpenGl/OpenGl_TextureBox.hxx | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-07-13 19:01 | Pawel | New Issue | |
2012-07-13 19:01 | Pawel | Assigned To | => Pawel |
2012-07-13 19:09 | Pawel | Description Updated | |
2012-07-13 19:12 | Pawel | Note Added: 0020977 | |
2012-07-13 19:12 | Pawel | Assigned To | Pawel => bugmaster |
2012-07-13 19:12 | Pawel | Status | new => resolved |
2012-07-16 09:19 | kgv | Note Added: 0020978 | |
2012-07-16 09:19 | kgv | Assigned To | bugmaster => Pawel |
2012-07-16 09:19 | kgv | Status | resolved => assigned |
2012-07-16 12:57 | Pawel | Note Added: 0020983 | |
2012-07-16 12:58 | Pawel | Note Added: 0020984 | |
2012-07-16 12:58 | Pawel | Assigned To | Pawel => kgv |
2012-07-16 12:58 | Pawel | Status | assigned => resolved |
2012-07-20 19:08 | Pawel | Note Added: 0021100 | |
2012-07-20 19:08 | Pawel | Status | resolved => feedback |
2012-10-18 20:49 | kgv | Note Added: 0021845 | |
2012-10-18 20:49 | kgv | Assigned To | kgv => san |
2012-10-18 20:49 | kgv | Status | feedback => resolved |
2012-10-19 14:50 |
|
Note Added: 0021850 | |
2012-10-19 14:50 |
|
Assigned To | san => bugmaster |
2012-10-19 14:50 |
|
Status | resolved => reviewed |
2012-10-19 19:59 | kgv | Note Added: 0021863 | |
2012-10-23 11:31 |
|
Target Version | 6.5.4 => 6.6.0 |
2012-10-23 16:18 |
|
Assigned To | bugmaster => mkv |
2012-10-31 11:02 | apn | Note Added: 0022025 | |
2012-10-31 11:03 | apn | Test case number | => Not needed |
2012-10-31 11:03 | apn | Assigned To | mkv => bugmaster |
2012-10-31 11:03 | apn | Status | reviewed => tested |
2012-11-16 13:03 | Pawel | Changeset attached | => occt master 43c34303 |
2012-11-16 13:03 | Pawel | Assigned To | bugmaster => Pawel |
2012-11-16 13:03 | Pawel | Status | tested => verified |
2012-11-16 13:03 | Pawel | Resolution | open => fixed |
2012-12-10 17:16 | Pawel | Changeset attached | => occt master 43c34303 |
2013-04-23 13:36 |
|
Status | verified => closed |
2013-04-29 15:21 |
|
Fixed in Version | => 6.6.0 |