1802
Extended Description
Reference counts can be used when tracking how many objects contain a reference to a particular
resource, such as in memory management or garbage collection. When the reference count
reaches zero, the resource can be de-allocated or reused because there are no more objects that
use it. If the reference count accidentally reaches zero, then the resource might be released too
soon, even though it is still in use. If all objects no longer use the resource, but the reference count
is not zero, then the resource might not ever be released.
Relationships
The table(s) below shows the weaknesses and high level categories that are related to this
weakness. These relationships are defined as ChildOf, ParentOf, MemberOr and give insight to
similar items that may exist at higher and lower levels of abstraction. In addition, relationships such
as PeerOf and CanAlsoBe are defined to show similar weaknesses that may want to be explored.
Relevant to the view "Research Concepts" (CWE-1000)
Nature Type ID Name Page
ChildOf 664 Improper Control of a Resource Through its Lifetime 1454
CanPrecede 672 Operation on a Resource after Expiration or Release 1479
CanPrecede 772 Missing Release of Resource after Effective Lifetime 1624
Relevant to the view "Software Development" (CWE-699)
Nature Type ID Name Page
MemberOf 399 Resource Management Errors 2324
Weakness Ordinalities
Primary :
Applicable Platforms
Language : C (Prevalence = Sometimes)
Language : C++ (Prevalence = Sometimes)
Language : Not Language-Specific (Prevalence = Undetermined)
Likelihood Of Exploit
Medium
Observed Examples
Reference Description
CVE-2002-0574 chain: reference count is not decremented, leading to memory leak in OS by
sending ICMP packets.
https://www.cve.org/CVERecord?id=CVE-2002-0574
CVE-2004-0114 Reference count for shared memory not decremented when a function fails,
potentially allowing unprivileged users to read kernel memory.
https://www.cve.org/CVERecord?id=CVE-2004-0114
CVE-2006-3741 chain: improper reference count tracking leads to file descriptor consumption
https://www.cve.org/CVERecord?id=CVE-2006-3741
CVE-2007-1383 chain: integer overflow in reference counter causes the same variable to be
destroyed twice.
https://www.cve.org/CVERecord?id=CVE-2007-1383
CVE-2007-1700 Incorrect reference count calculation leads to improper object destruction and
code execution.
https://www.cve.org/CVERecord?id=CVE-2007-1700
CVE-2008-2136 chain: incorrect update of reference count leads to memory leak.
https://www.cve.org/CVERecord?id=CVE-2008-2136
CWE Version 4.14
CWE-912: Hidden Functionality
CWE-912: Hidden Functionality