120-ubus-fix-refcounting-bug.patch 798 B

12345678910111213141516171819202122232425
  1. From: Felix Fietkau <[email protected]>
  2. Date: Fri, 6 Feb 2026 19:04:54 +0000
  3. Subject: [PATCH] ubus: fix refcounting bug
  4. In uc_ubus_channel_req_cb an extra ref is taken for args and method,
  5. which are not used elsewhere.
  6. Signed-off-by: Felix Fietkau <[email protected]>
  7. ---
  8. --- a/lib/ubus.c
  9. +++ b/lib/ubus.c
  10. @@ -2395,10 +2395,10 @@ uc_ubus_channel_req_cb(struct ubus_conte
  11. args = blob_array_to_ucv(c->vm, blob_data(msg), blob_len(msg), true);
  12. reqproto = ucv_object_new(c->vm);
  13. - ucv_object_add(reqproto, "args", ucv_get(args));
  14. + ucv_object_add(reqproto, "args", args);
  15. if (method)
  16. - ucv_object_add(reqproto, "type", ucv_get(ucv_string_new(method)));
  17. + ucv_object_add(reqproto, "type", ucv_string_new(method));
  18. return uc_ubus_handle_reply_common(ctx, req, c->vm, c->res, func, reqproto);
  19. }