[Bug 239520] Possible memory leak in newlocale/uselocale

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Jul 31 07:39:38 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239520

Baggio Kwok <rootkwok at cpan.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rootkwok at cpan.org

--- Comment #1 from Baggio Kwok <rootkwok at cpan.org> ---
Looks like the following atomic operation is not working as expected when
manipulating the reference count.

/usr/src/lib/libc/locale/xlocale_private.h:183
177 __attribute__((unused)) static void
178 xlocale_release(void *val)
179 {
180   struct xlocale_refcounted *obj = val;
181   long count;
182 
183   count = atomic_fetchadd_long(&(obj->retain_count), -1) - 1;
184   if (count < 0 && obj->destructor != NULL)
185     obj->destructor(obj);
186 }

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list