diff --git a/src/dnslib/dname-table.c b/src/dnslib/dname-table.c index 5337b8377e76786653f9968471fb29e05b142e26..0ff42e50d06acf0db7995d5df087612f2afaa5c5 100644 --- a/src/dnslib/dname-table.c +++ b/src/dnslib/dname-table.c @@ -81,6 +81,7 @@ static int dnslib_dname_table_copy_node(const struct dname_table_node *from, } (*to)->dname = from->dname; + dnslib_dname_retain((*to)->dname); (*to)->avl.avl_height = from->avl.avl_height; int ret = dnslib_dname_table_copy_node(from->avl.avl_left, diff --git a/src/dnslib/dname.h b/src/dnslib/dname.h index 03e9f59f1810c26e8bd334522032eba6cf207ffc..c96b943f94920eedaf8c7e65cb5c05ab358e8ee8 100644 --- a/src/dnslib/dname.h +++ b/src/dnslib/dname.h @@ -134,7 +134,7 @@ int dnslib_dname_from_wire(const uint8_t *name, unsigned int size, struct dnslib_node *node, dnslib_dname_t *target); /*! - * \brief Copies the given domain name. + * \brief Duplicates the given domain name. * * \note Copied dname referense count is reset to 1, caller is responsible * for releasing it after use. @@ -142,8 +142,6 @@ int dnslib_dname_from_wire(const uint8_t *name, unsigned int size, * \param dname Domain name to be copied. * * \return New domain name which is an exact copy of \a dname. - * - * \todo Deep/shallow copying. */ dnslib_dname_t *dnslib_dname_copy(const dnslib_dname_t *dname);