[asterisk-commits] mmichelson: branch group/dns r432549 - /team/group/dns/tests/test_dns.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 6 14:23:41 CST 2015


Author: mmichelson
Date: Fri Mar  6 14:23:40 2015
New Revision: 432549

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=432549
Log:
Remove memory leak in off-nominal record-adding test.


Modified:
    team/group/dns/tests/test_dns.c

Modified: team/group/dns/tests/test_dns.c
URL: http://svnview.digium.com/svn/asterisk/team/group/dns/tests/test_dns.c?view=diff&rev=432549&r1=432548&r2=432549
==============================================================================
--- team/group/dns/tests/test_dns.c (original)
+++ team/group/dns/tests/test_dns.c Fri Mar  6 14:23:40 2015
@@ -537,6 +537,7 @@
 
 AST_TEST_DEFINE(resolver_add_record_off_nominal)
 {
+	RAII_VAR(struct ast_dns_result *, result, NULL, ast_dns_result_free);
 	struct ast_dns_query some_query;
 	static const char *V4 = "127.0.0.1";
 	static const size_t V4_BUFSIZE = sizeof(struct in_addr);
@@ -575,6 +576,9 @@
 		return AST_TEST_FAIL;
 	}
 
+	/* We get the result so it will be cleaned up when the function exits */
+	result = ast_dns_query_get_result(&some_query);
+
 	/* Invalid RR types */
 	if (!ast_dns_resolver_add_record(&some_query, -1, ns_c_in, 12345, v4_buf, V4_BUFSIZE)) {
 		ast_test_status_update(test, "Successfully added DNS record with negative RR type\n");




More information about the asterisk-commits mailing list