network/queue: free assigned userdata only when a new request is queued

This commit is contained in:
Yu Watanabe
2023-07-29 23:27:19 +09:00
parent ae85704760
commit d256945fd0
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -134,7 +134,6 @@ static int request_new(
.link = link_ref(link), /* link may be NULL, but link_ref() handles it gracefully. */
.type = type,
.userdata = userdata,
.free_func = free_func,
.hash_func = hash_func,
.compare_func = compare_func,
.process = process,
@@ -153,6 +152,7 @@ static int request_new(
return r;
req->manager = manager;
req->free_func = free_func;
req->counter = counter;
if (req->counter)
(*req->counter)++;