From: short <> Date: Sun, 31 Aug 2003 12:57:06 +0000 (+0000) Subject: ntfs_attr_close(): Ignore NULL 'ntfs_attr'. X-Git-Tag: ntfsprogs_200309071734_captive1~12 X-Git-Url: http://git.jankratochvil.net/?p=ntfsprogs.git;a=commitdiff_plain;h=1e6208cb786b3745aa0897eaadac816faa9b3cb1;hp=6dea0443f86cb2d867b4e2f99aaaa7e8f40022c1 ntfs_attr_close(): Ignore NULL 'ntfs_attr'. - Fixes ntfs_readdir() of non-root directory SIGSEGV. --- diff --git a/libntfs/attrib.c b/libntfs/attrib.c index b04bb38..d8cc670 100644 --- a/libntfs/attrib.c +++ b/libntfs/attrib.c @@ -382,6 +382,8 @@ err_out: */ void ntfs_attr_close(ntfs_attr *na) { + if (!na) + return; if (NAttrNonResident(na) && na->rl) free(na->rl); /* Don't release if using an internal constant. */