Project

General

Profile

Actions

Bug #1156

closed

Need to check return value of DcmList::append(), DcmList::prepend() and DcmList::insert() to avoid possible memory leaks

Added by Jörg Riesmeier 10 months ago. Updated 14 days ago.

Status:
WontFix
Priority:
Normal
Assignee:
-
Category:
Library
Target version:
-
Start date:
2025-03-09
Due date:
% Done:

0%

Estimated time:
Module:
dcmdata
Operating System:
Compiler:

Description

The methods DcmList::append(), DcmList::prepend() and DcmList::insert() may return NULL if the passed object could not be appended, prepended or inserted into the list. In this case, the caller must delete the memory associated with the object.

Actions #1

Updated by Marco Eichelberg 15 days ago

  • Status changed from New to WontFix

The calls to DcmList::append(), DcmList::prepend() and DcmList::insert() can only fail (and return NULL) when the number of entries in the list is equal to (size_t)-1, which is impossible because memory will be exhausted before this situation can ever occur. There is, therefore, no risk of memory leaks if the return value is ignored.

Actions #2

Updated by Jörg Riesmeier 14 days ago

In fact, the maximum value DCM_EndOfListIndex is defined with the type unsigned long, which may be smaller than size_t on some systems.

Actions

Also available in: Atom PDF