Hi,

> > > > Another thing:, the relocatable module documentation recommends using:
> > > >   bindtextdomain (PACKAGE, relocate (LOCALEDIR));
> > > > however, the result of relocate may be LOCALEDIR itself (no
> > > > relocation) or a newly allocated string.
> 
> Yes, this is by design: The relocate() call is meant to be a no-op when
> not relocating. People like to use a facility with extra features only when
> it costs nothing if the feature is not used.

Yeah, but that leaks.

> But, more importantly, there's no documentation that says that relocate()
> returns either the argument string or a freshly allocated string; it could
> also return - say - a pointer into a hidden global obstack. In fact, one
> of the return paths of the function (see lib/relocatable.c) returns a
> cached global variable that you must not free.

What should be done instead?

-- 
Sylvain


Reply via email to