Project

General

Profile

Actions

Bug #390

open

Memory leaks in storescu, findscu und Co.

Added by Jörg Riesmeier about 14 years ago. Updated over 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

50%

Estimated time:
Module:
dcmnet (und weitere?)
Operating System:
Compiler:

Description

found with valgrind on caesar
It seems that 'ASC_destroyAssociation()' is not called in certain places in order to free the memory associated with the 'assoc' structure. This manifests itself in erroneous behaviour (e.g. unsuccessful negotiation of Presentation Contexts, no connection with the Communication Partner).

Associated Patch: "Added new class template "OFResourceHandle" for RAII-style (leak free) programming and used it to fix some memory leaks in storescu." T_ASC_Association_Handle is introduced in this template, which includes ASC_destroyAssociation's functionality.

If you replace all instances of T_ASC_Association with T_ASC_Association_Handle, ASC_destroyAssociation be called for each object. In some parts of the code, one must be careful as get() will be called on this handle to get the pointer.
In most cases the overloaded operators in OFResourceHandle should ensure that the handle will contain the pointer as before and not require that the code be adapted.

TODO:
- So far this has only been fixed in storescu, needs to be done for the others
- Test if all leaks have been fixed
- Adjust the scope of T_ASC_Association_Handle objects so that resources are released as early as possible and not at the end of main.


Files

ofhand.patch (8.26 KB) ofhand.patch Jan Schlamelcher, 2012-08-01 18:08

Related issues 2 (0 open2 closed)

Related to DCMTK - Bug #832: another echo SCU false positiveClosedPedro Fernando Arizpe Gómez2018-05-032018-05-04

Actions
Related to DCMTK - Bug #831: echo SCU false positiveClosedPedro Fernando Arizpe Gómez2018-05-032018-05-03

Actions
Actions

Also available in: Atom PDF