diff options
Diffstat (limited to 'nptl/pthread_attr_destroy.c')
-rw-r--r-- | nptl/pthread_attr_destroy.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/nptl/pthread_attr_destroy.c b/nptl/pthread_attr_destroy.c index 21f8026a2c..b6a3cca657 100644 --- a/nptl/pthread_attr_destroy.c +++ b/nptl/pthread_attr_destroy.c @@ -30,12 +30,16 @@ __pthread_attr_destroy (pthread_attr_t *attr) iattr = (struct pthread_attr *) attr; #if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_1) - /* In old struct pthread_attr, neither next nor cpuset are - present. */ + /* In old struct pthread_attr, the extension member is missing. */ if (__builtin_expect ((iattr->flags & ATTR_FLAG_OLDATTR), 0) == 0) #endif - /* The affinity CPU set might be allocated dynamically. */ - free (iattr->cpuset); + { + if (iattr->extension != NULL) + { + free (iattr->extension->cpuset); + free (iattr->extension); + } + } return 0; } |