This is the mail archive of the
pthreads-win32@sourceware.cygnus.com
mailing list for the pthreas-win32 project.
Re: 'pthread_mutex_destroy' memory leak report
- To: Milan Gardian <mg@tatramed.sk>
- Subject: Re: 'pthread_mutex_destroy' memory leak report
- From: Ross Johnson <rpj@ise.canberra.edu.au>
- Date: Wed, 8 Sep 1999 12:59:49 +1000 (EST)
- cc: pthreads-win32@sourceware.cygnus.com
On Tue, 7 Sep 1999, Milan Gardian wrote:
> Dear pthreads colleagues,
>
> Purify has recently reported to me a memory leak that originated in my
> pthread mutex adapter class. I have investigated deeper into the code and
> here are my findings:
>
[snip]
>
> My advice is to insert 'free(mx)' call into 'pthread_mutex_destroy' function
> before returning status to the caller (if mx has reasonable value, of
> course) as follows:
>
> ===
> file: pthreads_dir/mutex.c
> line: 197 - 204
> func: pthread_mutex_destroy
>
> if (result == 0)
> {
> mx->mutex = 0;
> free (mx);
> *mutex = NULL;
> }
>
> return(result);
> ===
>
Hi Milan,
Your fix will be in the next snapshot.
Thanks.
Ross
+----------------------+---+
| Ross Johnson | | E-Mail: rpj@ise.canberra.edu.au
| Info Sciences and Eng|___|
| University of Canberra | FAX: +61 6 2015227
| PO Box 1 |
| Belconnen ACT 2616 | WWW: http://willow.canberra.edu.au/~rpj/
| AUSTRALIA |
+--------------------------+