2982. [bug] Reference count dst keys. dst_key_attach() can be used

increment the reference count.

                        Note: dns_tsigkey_createfromkey() callers should now
                        always call dst_key_free() rather than setting it
                        to NULL on success. [RT #22672]
This commit is contained in:
Mark Andrews
2010-12-09 00:54:34 +00:00
parent c2ebdf2c49
commit 9f9b7f0e8d
14 changed files with 95 additions and 48 deletions

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: keydelete.c,v 1.15 2010/12/02 23:46:56 tbox Exp $ */
/* $Id: keydelete.c,v 1.16 2010/12/09 00:54:33 marka Exp $ */
#include <config.h>
@@ -230,8 +230,9 @@ main(int argc, char **argv) {
CHECK("dst_key_fromnamedfile", result);
result = dns_tsigkey_createfromkey(dst_key_name(dstkey),
DNS_TSIG_HMACMD5_NAME,
&dstkey, ISC_TRUE, NULL, 0, 0,
dstkey, ISC_TRUE, NULL, 0, 0,
mctx, ring, &tsigkey);
dst_key_free(&dstkey);
CHECK("dns_tsigkey_createfromkey", result);
(void)isc_app_run();