mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
Fix closedir usage in virNumaGetPages
virNumaGetPages calls closedir(dir) in cleanup and dir could be NULL if we jump there from the failed opendir() call. While it's not harmful on Linux, FreeBSD libc crashes [1], so make sure that dir is not NULL before calling closedir. 1: http://lists.freebsd.org/pipermail/freebsd-standards/2014-January/002704.html
This commit is contained in:
parent
60c343f688
commit
4a82ef92be
@ -843,7 +843,8 @@ virNumaGetPages(int node,
|
||||
VIR_FREE(tmp_free);
|
||||
VIR_FREE(tmp_avail);
|
||||
VIR_FREE(tmp_size);
|
||||
closedir(dir);
|
||||
if (dir)
|
||||
closedir(dir);
|
||||
VIR_FREE(path);
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user