We should initialize lxc_fd_list before opendir in
__lxc_fd_collect_inherited in case of opendir returns error.
Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.doin.ne.jp>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
int fd, fddir;
DIR *dir;
+ lxc_list_init(&lxc_fd_list);
+
dir = opendir("/proc/self/fd");
if (!dir) {
WARN("failed to open directory: %s", strerror(errno));
fddir = dirfd(dir);
- lxc_list_init(&lxc_fd_list);
-
while (!readdir_r(dir, &dirent, &direntp)) {
if (!direntp)