Menu

#119 window.c: resources leaked on error in StringRead()

2.1
closed
nobody
None
1
2025-12-06
2025-11-25
No

StringRead() allocates a few resources and normally releases them at the end of the function. But there are cases where StringRead() returns early due to an error, e.g. failure to allocate a particular resource. In some of these cases, that leads to other resources being leaked.

The attached patch attempts to resolve this, however I have not tested it on Windows. I wonder if it would be better to use a goto cleanup approach.

1 Attachments

Discussion

  • Paul Obermeier

    Paul Obermeier - 2025-12-06
    • status: open --> closed
     
  • Paul Obermeier

    Paul Obermeier - 2025-12-06

    Used goto approach.
    Tested on Windows and Linux.

     

Log in to post a comment.