dcavalca / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone
803fb7
From fb1115e5738b798bb99e5a699838395ca463e29d Mon Sep 17 00:00:00 2001
803fb7
From: Michal Schmidt <mschmidt@redhat.com>
803fb7
Date: Tue, 17 Feb 2015 10:33:01 +0100
803fb7
Subject: [PATCH] journal-remote: fix certificate status memory leak
803fb7
803fb7
The output of gnutls_certificate_verification_status_print() needs to be
803fb7
freed.
803fb7
803fb7
Noticed this while staring at verify_cert_authorized() to see what could
803fb7
possibly confuse gcc5 on armv7hl to segfault during compilation.
803fb7
803fb7
(cherry picked from commit 9c3cf9693ac5c0a332ba376f99e6adea28b1bb0d)
803fb7
---
803fb7
 src/journal-remote/microhttpd-util.c | 1 +
803fb7
 1 file changed, 1 insertion(+)
803fb7
803fb7
diff --git a/src/journal-remote/microhttpd-util.c b/src/journal-remote/microhttpd-util.c
803fb7
index 34d93379d..de9c6ab32 100644
803fb7
--- a/src/journal-remote/microhttpd-util.c
803fb7
+++ b/src/journal-remote/microhttpd-util.c
803fb7
@@ -179,6 +179,7 @@ static int verify_cert_authorized(gnutls_session_t session) {
803fb7
                 return log_error_errno(r, "gnutls_certificate_verification_status_print failed: %m");
803fb7
 
803fb7
         log_info("Certificate status: %s", out.data);
803fb7
+        gnutls_free(out.data);
803fb7
 
803fb7
         return status == 0 ? 0 : -EPERM;
803fb7
 }