Dmitry Antipov wrote: > IMO the best approach is to review/fix src/gnutls.c to handle GNUTLS_E_MEMORY_ERROR > among other errors and don't interfere in the library itself in any way. Yes, that sounds right. Proposed patches attached. The first patch is purely a mechanical one to simplify maintenance, so that the mainline part of src/gnutls.c can use ordinary identifiers like gnutls_global_init instead of funky names like like fn_gnutls_global_init (the patch moves the funky names into the WINDOWSNT section). The second patch fixes src/gnutls.c to check for memory exhaustion after every call to a GnuTLS function that can report memory exhaustion, instead of relying on the deprecated gnutls_global_set_mem_functions API. Since this affects the WINDOWSNT code I'll CC: Eli.