projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6ef8cd7
)
crypto: fix leaks in TLS x509 helper functions
author
Daniel P. Berrange
<berrange@redhat.com>
Wed, 18 Nov 2015 14:44:31 +0000
(14:44 +0000)
committer
Daniel P. Berrange
<berrange@redhat.com>
Wed, 18 Nov 2015 14:56:58 +0000
(14:56 +0000)
The test_tls_get_ipaddr() method forgot to free the returned data
from getaddrinfo().
The test_tls_write_cert_chain() method forgot to free the allocated
buffer holding the certificate data after writing it out to a file.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
tests/crypto-tls-x509-helpers.c
patch
|
blob
|
history
diff --git
a/tests/crypto-tls-x509-helpers.c
b/tests/crypto-tls-x509-helpers.c
index c5de67baafff52e6fe77ae31cd478842fc2f9762..47b4c7ba53fe60ed531f4718f4cd6ef7c8a061f6 100644
(file)
--- a/
tests/crypto-tls-x509-helpers.c
+++ b/
tests/crypto-tls-x509-helpers.c
@@
-153,6
+153,7
@@
test_tls_get_ipaddr(const char *addrstr,
*datalen = res->ai_addrlen;
*data = g_new(char, *datalen);
memcpy(*data, res->ai_addr, *datalen);
+ freeaddrinfo(res);
}
/*
@@
-465,6
+466,7
@@
void test_tls_write_cert_chain(const char *filename,
if (!g_file_set_contents(filename, buffer, offset, NULL)) {
abort();
}
+ g_free(buffer);
}