network: introduce reference counter for Request object
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 27 Feb 2022 06:18:01 +0000 (15:18 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 11 Mar 2022 05:20:31 +0000 (14:20 +0900)
commite9ef9a1484e39c468b372f75058fef8c59009deb
treefa16ee6cb25fa66f71eedab42b8ec1e20efffceb
parentff51134c93a748524b75b4fd492f9c03cb02f65c
network: introduce reference counter for Request object

Currently, all Request object are always owned by Manager, and freed
when it is processed, especially, soon after a netlink message is sent.
So, it is not necessary to introduce the reference counter.

In a later commit, the Request object will _not_ be freed at the time
when a netlink message is sent, but assigned to the relevant netlink
slot as a userdata, and will be freed when a reply is received. So, the
owner of the Request object is changed in its lifetime. In that case, it
is convenient that the object has reference counter to avoid memleak or
double free.
src/network/networkd-queue.c
src/network/networkd-queue.h