Skip to content

Commit

Permalink
Merge pull request #142 from nbd168/ref-fixes
Browse files Browse the repository at this point in the history
Fix reference count issues
  • Loading branch information
jow- authored Feb 13, 2023
2 parents c43bb9d + 9022b27 commit 837cffe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -2514,7 +2514,7 @@ uc_nl_listener(uc_vm_t *vm, size_t nargs)
break;
}

ucv_array_set(listener_registry, i + 1, cb_func);
ucv_array_set(listener_registry, i + 1, ucv_get(cb_func));
l = xalloc(sizeof(*l));
l->index = i;
if (!uc_nl_fill_cmds(l->cmds, cmds)) {
Expand All @@ -2524,7 +2524,7 @@ uc_nl_listener(uc_vm_t *vm, size_t nargs)
}

rv = uc_resource_new(listener_type, l);
ucv_array_set(listener_registry, i, rv);
ucv_array_set(listener_registry, i, ucv_get(rv));
listener_vm = vm;

return rv;
Expand Down
4 changes: 2 additions & 2 deletions lib/rtnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -3704,7 +3704,7 @@ uc_nl_listener(uc_vm_t *vm, size_t nargs)
break;
}

ucv_array_set(listener_registry, i + 1, cb_func);
ucv_array_set(listener_registry, i + 1, ucv_get(cb_func));
l = xalloc(sizeof(*l));
l->index = i;
if (!uc_nl_fill_cmds(l->cmds, cmds)) {
Expand All @@ -3714,7 +3714,7 @@ uc_nl_listener(uc_vm_t *vm, size_t nargs)
}

rv = uc_resource_new(listener_type, l);
ucv_array_set(listener_registry, i, rv);
ucv_array_set(listener_registry, i, ucv_get(rv));
listener_vm = vm;

return rv;
Expand Down

0 comments on commit 837cffe

Please sign in to comment.