Fixed memory leak in SASL PLAIN
authorAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 12 Aug 2013 09:52:32 +0000 (11:52 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 15 Aug 2013 21:34:23 +0000 (23:34 +0200)
src/libpttls/sasl/sasl_plain/sasl_plain.c

index fdb3523..019c1b0 100644 (file)
@@ -117,11 +117,14 @@ METHOD(sasl_mechanism_t, build_client, status_t,
        len = snprintf(buf, sizeof(buf), "%s%c%Y%c%.*s",
                                   "", 0, this->client, 0,
                                   (int)password.len, password.ptr);
+       shared->destroy(shared);
+
        if (len < 0 || len >= sizeof(buf))
        {
                return FAILED;
        }
        *message = chunk_clone(chunk_create(buf, len));
+
        return NEED_MORE;
 }