You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
423 B

  1. --- a/src/lxc/bdev.c
  2. +++ b/src/lxc/bdev.c
  3. @@ -1939,7 +1939,7 @@ static int find_free_loopdev(int *retfd,
  4. static int loop_mount(struct bdev *bdev)
  5. {
  6. - int lfd, ffd = -1, ret = -1;
  7. + int lfd = -1, ffd = -1, ret = -1;
  8. struct loop_info64 lo;
  9. char loname[100];
  10. @@ -1977,7 +1977,7 @@ out:
  11. if (ffd > -1)
  12. close(ffd);
  13. if (ret < 0) {
  14. - close(lfd);
  15. + if (lfd > -1) close(lfd);
  16. bdev->lofd = -1;
  17. }
  18. return ret;