possible memory leak in libhal_drive_from_udi

Soren Hansen sh at linux2go.dk
Thu Feb 16 14:39:09 PST 2006


On Thu, Feb 16, 2006 at 02:07:51PM -0800, Brendan Creane wrote:
> The libhal_drive_free frees all the strings that "drive" points to,
> but the "drive" structure itself is (apparently) never freed. 

I agree. That doesn't look right. The same holds true for
libhal_volume_from_udi.

> Is this a legitimate problem, and has it been fixed in a later release
> of libhal? 

The problem still exists in the latest CVS.

I'm not sure whether this is a bug in libhal_volume_from_udi and
libhal_drive_from_udi or libhal_volume_free and libhal_drive_free?

Should the *_free functions also free the struct itself or is that
typically a responsibility of the calling function?

-- 
| Soren Hansen    | Linux2Go                  | http://Linux2Go.dk/ |
| Seniorkonsulent | Lindholmsvej 42, 2. TH    | +45 46 90 26 42     |
| sh at linux2go.dk  | 9400 Norresundby, Denmark | GPG key: E8BDA4E3   |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/hal/attachments/20060216/dc021d0e/attachment.pgp


More information about the hal mailing list