Net: Fix resource leak in ReadBinaryFile(...) #10587

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:fopen-not-followed-by-fclose-in-all-states-of-the-universe changing 1 files +3 −1
  1. practicalswift commented at 3:50 PM on June 14, 2017: contributor

    Potential file descriptor leak introduced in commit 0b6f40d4cabb3bebf551a49a69ce36d4b0375b6a via PR #10408 (submitted 2017-05-16, merged 2017-05-18).

  2. Net: Fix resource leak in ReadBinaryFile(...)
    Introduced in 0b6f40d4cabb3bebf551a49a69ce36d4b0375b6a via PR #10408.
    f2fb132cb0
  3. theuni commented at 9:51 PM on June 14, 2017: member

    utACK f2fb132cb09efb253df44db09035d4210cc61236, but RAII would be nice here.

  4. fanquake added the label P2P on Jun 15, 2017
  5. sipa commented at 11:34 PM on June 16, 2017: member

    @theuni Agree, but since the existing code is using fopen/fread/fclose, let's keep using that in the bug fix. The rest can happen later.

    utACK f2fb132cb09efb253df44db09035d4210cc61236

  6. sipa merged this on Jun 16, 2017
  7. sipa closed this on Jun 16, 2017

  8. sipa referenced this in commit de8db47b7f on Jun 16, 2017
  9. practicalswift commented at 4:21 AM on June 17, 2017: contributor

    Friendly ping @str4d – you might want this fix in zcash too :-)

  10. str4d commented at 6:46 AM on June 23, 2017: contributor

    Thanks @practicalswift, nice catch!

  11. laanwj commented at 10:30 AM on June 24, 2017: member

    utACK f2fb132, but RAII would be nice here.

    Yes it's pretty easy to make a RAII for FILE* using unique_ptr with a custom deleter, we could even make our fsbridge::fopen return this. Agree with not doing it in this PR though.

  12. jasonbcox referenced this in commit be756d0c7f on Jun 28, 2019
  13. jasonbcox referenced this in commit 2f1adeefb6 on Jun 28, 2019
  14. jtoomim referenced this in commit 5f44f14f0b on Jun 29, 2019
  15. jtoomim referenced this in commit e2873e149f on Jun 29, 2019
  16. PastaPastaPasta referenced this in commit 874b22571e on Jul 5, 2019
  17. PastaPastaPasta referenced this in commit fd08d30093 on Jul 5, 2019
  18. jonspock referenced this in commit f4518c7324 on Jul 6, 2019
  19. jonspock referenced this in commit e567c64a94 on Jul 6, 2019
  20. PastaPastaPasta referenced this in commit b7535acc07 on Jul 6, 2019
  21. jonspock referenced this in commit 8f36468989 on Jul 7, 2019
  22. jonspock referenced this in commit 85c483cec9 on Jul 7, 2019
  23. jonspock referenced this in commit 9309d597de on Jul 7, 2019
  24. jonspock referenced this in commit 4f51d749b6 on Jul 7, 2019
  25. proteanx referenced this in commit 79443d9cf3 on Jul 7, 2019
  26. proteanx referenced this in commit 75f2a3fca4 on Jul 7, 2019
  27. PastaPastaPasta referenced this in commit 338d80c78e on Jul 8, 2019
  28. jonspock referenced this in commit 277beb95d1 on Jul 9, 2019
  29. jonspock referenced this in commit d0f7c152c3 on Jul 9, 2019
  30. PastaPastaPasta referenced this in commit f50dcd1f67 on Jul 9, 2019
  31. PastaPastaPasta referenced this in commit 0647ea6564 on Jul 9, 2019
  32. barrystyle referenced this in commit 4970c13f7b on Jan 22, 2020
  33. random-zebra referenced this in commit 0a4072e4fc on Apr 4, 2020
  34. wqking referenced this in commit c68f5663ec on Sep 4, 2020
  35. practicalswift deleted the branch on Apr 10, 2021
  36. DrahtBot locked this on Aug 18, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-15 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me