Bug #2071

"libhal_device_free_changeset" function mem-leeks.

Added by Roman Strashkin about 2 years ago. Updated about 2 years ago.

Status:Resolved Start date:2012-02-03
Priority:Normal Due date:
Assignee:Milan Jurik % Done:

100%

Category:lib - userland libraries Spent time: -
Target version:-
Difficulty:Bite-size Tags:

Description

http://src.illumos.org/source/s?refs=libhal_device_free_changeset&project=illumos-gate

"LibHalChangeSetElement" struct contains "key" member, which is not freed by the function.

fix:

diff -r 48985d630b76 usr/src/lib/hal/libhal/common/libhal.c
--- a/usr/src/lib/hal/libhal/common/libhal.c    Mon Jan 30 18:55:11 2012 +0100
+++ b/usr/src/lib/hal/libhal/common/libhal.c    Fri Feb 03 08:57:57 2012 -0800
@@ -4182,6 +4182,7 @@
                        fprintf (stderr, "%s %d : unknown change_type %d\n", __FILE__, __LINE__, elem->change_type);
                        break;
                }
+         free (elem->key);
                free (elem);
        }


Related issues

related to illumos gate - Feature #2100: update HAL to 0.5.14 New 2012-03-28
related to illumos gate - Bug #2555: libhal does not unref some messages Resolved 2012-03-28
related to illumos gate - Bug #2666: libhal should be more carefull about function parameters Resolved 2012-05-01

History

Updated by Milan Jurik about 2 years ago

  • Status changed from New to In Progress
  • Assignee set to Milan Jurik
  • Tags deleted (needs-triage)

It seems there are few leaks more in the code, I will look at them.

Updated by Igor Pashev about 2 years ago

Why HAL is maintained in illumos-gate? It should be in userland.

Updated by Rich Lowe about 2 years ago

Because all the important parts had to be written fresh for the Solaris port, and it (in theory, I haven't checked recently) consumes some deeply private interfaces.

Updated by Milan Jurik about 2 years ago

  • % Done changed from 0 to 20

Not only that. Upstream abandoned HAL, so all its development is on us now anyway. Some of Solaris specific parts were pushed to upstream but it does not seem all was done before HAL upstream stalled.

Updated by Milan Jurik about 2 years ago

  • % Done changed from 20 to 100
  • Difficulty changed from Medium to Bite-size

Updated by Milan Jurik about 2 years ago

Fix for RTI matches what Roman Strashkin proposed, it is from upstream.

The rest of possible leaks is covered by other issues.

Updated by Milan Jurik about 2 years ago

  • Status changed from In Progress to Pending RTI

Updated by Rich Lowe about 2 years ago

  • Status changed from Pending RTI to Resolved

Resolved in r13658 1e6115622470

Also available in: Atom PDF