Greetings,

I've discovered wolfSSL 2.2.0 embedded SSL constantly leaking 1 byte and 128 byte blocks when used from inside libcurl to access https URL.

I've narrowed down the problem to function internal.c:DoServerKeyExchange()

I made a tentative fix that seems to resolve the problem for me, but I am unsure if it breaks another usecases.

My setup:
Architecture: LM32 nommu
OS: uClinux
libcurl 7.26.0
wolfSSl 2.2.0

CONFIGURE_ARGS += \
        --disable-shared \
        --enable-static \
        --without-zlib \
        --enable-opensslExtra \
        --enable-singleThreaded

Update:
attachments seem to not work on this forum, here is the patch

--- a/src/internal.c    2012-05-18 11:05:13.000000000 +1100
+++ b/src/internal.c    2012-07-19 13:44:47.012029364 +1100
@@ -4380,6 +4380,9 @@
             return MEMORY_ERROR;
         XMEMCPY(ssl->buffers.serverDH_Pub.buffer, &input[*inOutIdx], length);
         *inOutIdx += length;
+
+        ssl->buffers.weOwnDH = 1;
+
         }  /* dh_kea */
     #endif /* OPENSSL_EXTRA */