On 18 Nov 2020, at 19:44, Stefan Eßer <s...@freebsd.org> wrote: > + /* > + * Check for some other thread already having > + * set localbase - this should use atomic ops. > + * The amount of memory allocated above may leak, > + * if a parallel update in another thread is not > + * detected and the non-NULL pointer is overwritten. > + */
Why was this committed with a known racy/leaky implementation? What happens if I set the value with a sysctl and call this? Jess > + if (tmppath[0] != '\0' && > + (volatile const char*)localbase == NULL) > + localbase = tmppath; > + else > + free((void*)tmppath); > + return (localbase); > + } > + return (_PATH_LOCALBASE); > +} _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"