httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Havard" <>
Subject APR file_io and memory allocation
Date Fri, 09 Apr 1999 07:03:00 GMT
  I'm putting together an OS/2 implementation of the file_io stuff and found
that the unix implementation leaks memory. apr_open malloc()s the apr_file_t
and strdup()s the fname but neither are freed at any point. 

  I would think that apr_close() should clean up all memory allocated by
apr_open() but this would prevent file->fname being used after the file is
closed (and this is done in testfile.c).

  If the application is supposed to free() the file handle it will leak the
memory used by fname and anything else that might be added in the future.

Anyone disagree?

 |  Brian Havard                 |  "He is not the messiah!                   |
 |  |  He's a very naughty boy!" - Life of Brian |

View raw message