mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 23:25:38 +00:00
Fix warnings in dlz_mysqldyn_mod.c
dlz_mysqldyn_mod.c: In function ‘dlz_findzonedb’: dlz_mysqldyn_mod.c:1079:73: warning: unused parameter ‘methods’ [-Wunused-parameter] 1079 | dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods, | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ dlz_mysqldyn_mod.c:1080:34: warning: unused parameter ‘clientinfo’ [-Wunused-parameter] 1080 | dns_clientinfo_t *clientinfo) { | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~ dlz_mysqldyn_mod.c: In function ‘dlz_lookup’: dlz_mysqldyn_mod.c:1111:63: warning: unused parameter ‘methods’ [-Wunused-parameter] 1111 | dns_sdlzlookup_t *lookup, dns_clientinfomethods_t *methods, | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ dlz_mysqldyn_mod.c: In function ‘build_query’: dlz_mysqldyn_mod.c:465:19: warning: pointer ‘item’ used after ‘free’ [-Wuse-after-free] 465 | item = DLZ_LIST_NEXT(item, link)) dlz_mysqldyn_mod.c:470:17: note: call to ‘free’ here 470 | free(item); | ^~~~~~~~~~
This commit is contained in:
@@ -54,3 +54,17 @@
|
|||||||
|
|
||||||
#define DLZ_LIST_PREV(elt, link) ((elt)->link.prev)
|
#define DLZ_LIST_PREV(elt, link) ((elt)->link.prev)
|
||||||
#define DLZ_LIST_NEXT(elt, link) ((elt)->link.next)
|
#define DLZ_LIST_NEXT(elt, link) ((elt)->link.next)
|
||||||
|
|
||||||
|
#define DLZ_LIST_UNLINK(list, elt, link) \
|
||||||
|
do { \
|
||||||
|
if ((elt)->link.next != NULL) \
|
||||||
|
(elt)->link.next->link.prev = (elt)->link.prev; \
|
||||||
|
else \
|
||||||
|
(list).tail = (elt)->link.prev; \
|
||||||
|
if ((elt)->link.prev != NULL) \
|
||||||
|
(elt)->link.prev->link.next = (elt)->link.next; \
|
||||||
|
else \
|
||||||
|
(list).head = (elt)->link.next; \
|
||||||
|
(elt)->link.prev = (void *)(-1); \
|
||||||
|
(elt)->link.next = (void *)(-1); \
|
||||||
|
} while (0)
|
||||||
|
@@ -461,9 +461,8 @@ build_query(mysql_data_t *state, mysql_instance_t *dbi, const char *command,
|
|||||||
fail:
|
fail:
|
||||||
va_end(ap1);
|
va_end(ap1);
|
||||||
|
|
||||||
for (item = DLZ_LIST_HEAD(arglist); item != NULL;
|
while ((item = DLZ_LIST_HEAD(arglist)) != NULL) {
|
||||||
item = DLZ_LIST_NEXT(item, link))
|
DLZ_LIST_UNLINK(arglist, item, link);
|
||||||
{
|
|
||||||
if (item->arg != NULL) {
|
if (item->arg != NULL) {
|
||||||
free(item->arg);
|
free(item->arg);
|
||||||
}
|
}
|
||||||
@@ -1078,6 +1077,8 @@ dlz_destroy(void *dbdata) {
|
|||||||
isc_result_t
|
isc_result_t
|
||||||
dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
|
||||||
dns_clientinfo_t *clientinfo) {
|
dns_clientinfo_t *clientinfo) {
|
||||||
|
UNUSED(methods);
|
||||||
|
UNUSED(clientinfo);
|
||||||
isc_result_t result = ISC_R_SUCCESS;
|
isc_result_t result = ISC_R_SUCCESS;
|
||||||
mysql_data_t *state = (mysql_data_t *)dbdata;
|
mysql_data_t *state = (mysql_data_t *)dbdata;
|
||||||
MYSQL_RES *res;
|
MYSQL_RES *res;
|
||||||
@@ -1110,6 +1111,8 @@ isc_result_t
|
|||||||
dlz_lookup(const char *zone, const char *name, void *dbdata,
|
dlz_lookup(const char *zone, const char *name, void *dbdata,
|
||||||
dns_sdlzlookup_t *lookup, dns_clientinfomethods_t *methods,
|
dns_sdlzlookup_t *lookup, dns_clientinfomethods_t *methods,
|
||||||
dns_clientinfo_t *clientinfo) {
|
dns_clientinfo_t *clientinfo) {
|
||||||
|
UNUSED(methods);
|
||||||
|
UNUSED(clientinfo);
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
mysql_data_t *state = (mysql_data_t *)dbdata;
|
mysql_data_t *state = (mysql_data_t *)dbdata;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
Reference in New Issue
Block a user