journal-remote: fix certificate status memory leak
authorMichal Schmidt <mschmidt@redhat.com>
Tue, 17 Feb 2015 09:33:01 +0000 (10:33 +0100)
committerMichal Schmidt <mschmidt@redhat.com>
Tue, 17 Feb 2015 09:34:15 +0000 (10:34 +0100)
The output of gnutls_certificate_verification_status_print() needs to be
freed.

Noticed this while staring at verify_cert_authorized() to see what could
possibly confuse gcc5 on armv7hl to segfault during compilation.

src/journal-remote/microhttpd-util.c

index 34d9337..de9c6ab 100644 (file)
@@ -179,6 +179,7 @@ static int verify_cert_authorized(gnutls_session_t session) {
                 return log_error_errno(r, "gnutls_certificate_verification_status_print failed: %m");
 
         log_info("Certificate status: %s", out.data);
+        gnutls_free(out.data);
 
         return status == 0 ? 0 : -EPERM;
 }