ryantimwilson / rpms / systemd

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