[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#503162: libc6: Doubt with nptl



On Thu, Oct 23, 2008 at 07:41:47PM +0700, Alexey Salmin wrote:
> > Freeing a variable...
> >
> > >       if (err = pthread_rwlock_unlock(q->data->rwlock)) {
> >
> > ...and using it later is never a good idea. This is a problem in your
> > program, closing the bug.
> 
> 
> ? Can you please explain where am I freeing a variable? AFAIK

Quoting your code:

	free(q);
	if (err = pthread_rwlock_unlock(q->data->rwlock)) {

q is freed, and then use as an argument to pthread_rwlock_unlock().

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net



Reply to: