cpp-subprocess icon indicating copy to clipboard operation
cpp-subprocess copied to clipboard

memory leak

Open jsho000 opened this issue 1 year ago • 1 comments

In the following code:

      int read_bytes = util::read_atmost_n(
                                  fdopen(err_rd_pipe, "r"),
                                  err_buf,
                                  SP_MAX_ERR_BUF_SIZ);
      close(err_rd_pipe);

The value returned by fdopen() is not closed. This causes memory leak. If you call fclose(), it will close err_rd_pipe. So close(err_rd_pipe) is not necessary.

jsho000 avatar Mar 21 '24 00:03 jsho000

@jsho000 Thank you for reporting. Can you provide a PR after testing the required changes ?

arun11299 avatar Jul 05 '24 04:07 arun11299

Will be fixed with https://github.com/arun11299/cpp-subprocess/issues/104

arun11299 avatar Jul 09 '24 03:07 arun11299