core/proxy: Fix leak found by covscan
authorOndrej Holy <oholy@redhat.com>
Fri, 17 Aug 2018 14:22:56 +0000 (16:22 +0200)
committerOndrej Holy <oholy@redhat.com>
Wed, 22 Aug 2018 12:34:02 +0000 (14:34 +0200)
leaked_storage: Variable "s" going out of scope leaks the storage it points to.

libfreerdp/core/proxy.c

index 0ec26a1..34e8363 100644 (file)
@@ -234,6 +234,7 @@ static BOOL http_proxy_connect(BIO* bufferedBio, const char* hostname, UINT16 po
 
        if (status != Stream_GetPosition(s))
        {
+               Stream_Free(s, TRUE);
                WLog_ERR(TAG, "HTTP proxy: failed to write CONNECT request");
                return FALSE;
        }