brainnolo,
The leak is the malloc. In spite of the caching of the pointer, this is not good style. The caching is done externally to the function, so anyone using this function must also be aware that it leaks, in this sense, you allocate a resource that should be freed in the future. I agree, it is just a few bytes, but it is ugly and unnecessary. And that is not the problem we are discussing here

I understand now your reasons to include the library in the bundle.
As for the wxStandardPaths, I don't want wx dependencies in the UPnP module. There is currently one dependency, a wxMutex, used for lazyness which will be removed soon. I wish to keep wx out of UPnP, so that the code can be reused independently.
BTW, it looks quite cumbersome to find a library like this. Isn't there a PATH or LD_LIBRARY_PATH equivalent? Why do you need a path? In the system wide version, there seems to be a working path. Can't you direct this path to the bundle directory?
aMule UPnP was designed to dlopen() so that it did not introduce a new library dependency and at the same time would be simple to test in CVS code, but maybe it is time to create a configure option and link UPnP directly, what do you think?