We have an implementation of setenv() in our portability code.
It is preferrable to calling putenv() on a buffer that's going out of scope imminently: putenv() doesn't take a copy, so the existing code puts an entry in the environment that subsequently gets trampled with cruft.  It doesn't (persistently) set LD_LIBRARY_PATH.
So I've converted it to setenv().  The alternatives were: (i) make the ld_library_path buffer static or (ii) strdup() the data and leak it.  I prefer to use setenv(), in this case; at least where the system does support it, there's some chance it'll tidy away any earlier setting of LD_LIBRARY_PATH; and it avoids the need for a fixed-size buffer, with all that implies about potential truncation of the value.