projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9c3cf96
)
journal-remote: fix client_cert memory leak
author
Michal Schmidt
<mschmidt@redhat.com>
Tue, 17 Feb 2015 09:36:57 +0000
(10:36 +0100)
committer
Michal Schmidt
<mschmidt@redhat.com>
Tue, 17 Feb 2015 09:36:57 +0000
(10:36 +0100)
Found by Valgrind while testing the previous memory leak fix.
src/journal-remote/microhttpd-util.c
patch
|
blob
|
history
diff --git
a/src/journal-remote/microhttpd-util.c
b/src/journal-remote/microhttpd-util.c
index
de9c6ab
..
a95fff1
100644
(file)
--- 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;