Re: [sleuthkit-users] more crashes
Brought to you by:
carrier
|
From: Gary F. <ga...@in...> - 2006-08-25 08:49:52
|
Simson Garfinkel wrote (in part):
>
> and the code:
> static void
> ntfs_secure_data_free(NTFS_INFO * ntfs_info)
> {
> // Iterate of sds entries and free them
> while (ntfs_info->sds) {
> => free(ntfs_info->sds->data);
> ntfs_info->sds = ntfs_info->sds->next;
> }
Probably unrelated to the current problem, but it seems
taht the code above will cause ntfs_info->sds to traverse
down the next links until at the end, ntfs_info->sds will
be set to null. However, the intermediate entries in the
list are not freed and unless these nodes are on some other
list, will become dangling references. Is this intended?
Or does something like the following implement the specified
operation?
static void
ntfs_secure_data_free(NTFS_INFO * ntfs_info)
{
NTFS_INFO *n, *nxt;
// Iterate of sds entries and free them
for (n = ntfs_info->sds; n; n = nxt)
{
if (n->data) free (n->data);
nxt = n->next;
free (n);
}
nfs_info->sds = 0;
}
|