summaryrefslogtreecommitdiffstats
path: root/src/journal-remote
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2015-02-17 10:36:57 +0100
committerMichal Schmidt <mschmidt@redhat.com>2015-02-17 10:36:57 +0100
commit32c3d7144cf9a5c8c03761d7f198142ca0f5f7b8 (patch)
tree1fd3c93164778fd339b2369e7a0e2e899ea22ffa /src/journal-remote
parentjournal-remote: fix certificate status memory leak (diff)
downloadsystemd-32c3d7144cf9a5c8c03761d7f198142ca0f5f7b8.tar.xz
systemd-32c3d7144cf9a5c8c03761d7f198142ca0f5f7b8.zip
journal-remote: fix client_cert memory leak
Found by Valgrind while testing the previous memory leak fix.
Diffstat (limited to 'src/journal-remote')
-rw-r--r--src/journal-remote/microhttpd-util.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/journal-remote/microhttpd-util.c b/src/journal-remote/microhttpd-util.c
index de9c6ab32d..a95fff18f3 100644
--- a/src/journal-remote/microhttpd-util.c
+++ b/src/journal-remote/microhttpd-util.c
@@ -239,10 +239,14 @@ static int get_auth_dn(gnutls_x509_crt_t client_cert, char **buf) {
return 0;
}
+static inline void gnutls_x509_crt_deinitp(gnutls_x509_crt_t *p) {
+ gnutls_x509_crt_deinit(*p);
+}
+
int check_permissions(struct MHD_Connection *connection, int *code, char **hostname) {
const union MHD_ConnectionInfo *ci;
gnutls_session_t session;
- gnutls_x509_crt_t client_cert;
+ _cleanup_(gnutls_x509_crt_deinitp) gnutls_x509_crt_t client_cert = NULL;
_cleanup_free_ char *buf = NULL;
int r;