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);
| ^~~~~~~~~~
(cherry picked from commit
587ea10567d05a405c75f2e31b3ef918233d9f8e)
#define DLZ_LIST_PREV(elt, link) ((elt)->link.prev)
#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)
+
#endif /* DLZ_LIST_H */
fail:
va_end(ap1);
- for (item = DLZ_LIST_HEAD(arglist); item != NULL;
- item = DLZ_LIST_NEXT(item, link))
- {
+ while ((item = DLZ_LIST_HEAD(arglist)) != NULL) {
+ DLZ_LIST_UNLINK(arglist, item, link);
if (item->arg != NULL) {
free(item->arg);
}
isc_result_t
dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
dns_clientinfo_t *clientinfo) {
+ UNUSED(methods);
+ UNUSED(clientinfo);
isc_result_t result = ISC_R_SUCCESS;
mysql_data_t *state = (mysql_data_t *)dbdata;
MYSQL_RES *res;
dlz_lookup(const char *zone, const char *name, void *dbdata,
dns_sdlzlookup_t *lookup, dns_clientinfomethods_t *methods,
dns_clientinfo_t *clientinfo) {
+ UNUSED(methods);
+ UNUSED(clientinfo);
isc_result_t result;
mysql_data_t *state = (mysql_data_t *)dbdata;
bool found = false;