Commit ca697342 by Serge Hallyn

coverity: don't leak open DIR

parent 01efd4d3
......@@ -1355,11 +1355,11 @@ static int find_free_loopdev(int *retfd, char *namep)
snprintf(namep, 100, "/dev/%s", direntp->d_name);
break;
}
closedir(dir);
if (fd == -1) {
ERROR("No loop device found");
return -1;
}
closedir(dir);
*retfd = fd;
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment