• Mike Kaganski's avatar
    LibreOfficeKitInit.h: release memory after lok_dlerror() on Windows · 36535c2b
    Mike Kaganski yazdı
    When _WIN32 is defined, lok_dlerror() uses FormatMessageA() call with
    FORMAT_MESSAGE_ALLOCATE_BUFFER flag [1] to get returned error string.
    This string is required to be released after use with LocalFree() (or
    HeapFree(), since LocalFree() is not available in recent SDKs).
    
    However, there is no mention in the header that this is required, nor
    lok_dlopen() that uses it does any cleanup. If the calling application
    is expected to be terminated in case of error, then that is no problem;
    but the header might be used in any external client application which
    we know nothing of.
    
    This adds corresponding cleanup function.
    
    Change-Id: I1f14cc5d9e10fe086c3646faaf0e19f2a7a6dd56
    Reviewed-on: https://gerrit.libreoffice.org/42360Tested-by: 's avatarJenkins <ci@libreoffice.org>
    Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
    36535c2b
LibreOfficeKitInit.h 8.61 KB