4060. [bug] dns_rdata_freestruct could be call on a uninitialised

structure when handling a error. [RT #38568]

(cherry picked from commit f4102ab13e)
This commit is contained in:
Mark Andrews
2015-02-11 16:51:25 +11:00
parent f31f3bf055
commit 31cdad2c40
2 changed files with 7 additions and 1 deletions
+3
View File
@@ -1,5 +1,8 @@
--- 9.9.7rc2 released ---
4060. [bug] dns_rdata_freestruct could be call on a uninitialised
structure when handling a error. [RT #38568]
4059. [bug] Addressed valgrind warnings. [RT #38549]
4058. [bug] UDP dispatches could use the wrong psuedorandom
+4 -1
View File
@@ -1397,6 +1397,7 @@ dns_tkey_gssnegotiate(dns_message_t *qmsg, dns_message_t *rmsg,
dst_key_t *dstkey = NULL;
isc_result_t result;
unsigned char array[1024];
isc_boolean_t freertkey = ISC_FALSE;
REQUIRE(qmsg != NULL);
REQUIRE(rmsg != NULL);
@@ -1409,6 +1410,7 @@ dns_tkey_gssnegotiate(dns_message_t *qmsg, dns_message_t *rmsg,
RETERR(find_tkey(rmsg, &tkeyname, &rtkeyrdata, DNS_SECTION_ANSWER));
RETERR(dns_rdata_tostruct(&rtkeyrdata, &rtkey, NULL));
freertkey = ISC_TRUE;
if (win2k == ISC_TRUE)
RETERR(find_tkey(qmsg, &tkeyname, &qtkeyrdata,
@@ -1461,7 +1463,8 @@ dns_tkey_gssnegotiate(dns_message_t *qmsg, dns_message_t *rmsg,
/*
* XXXSRA This probably leaks memory from qtkey.
*/
dns_rdata_freestruct(&rtkey);
if (freertkey)
dns_rdata_freestruct(&rtkey);
if (dstkey != NULL)
dst_key_free(&dstkey);
return (result);