sd_netlink_message *m;
int r;
- assert(ret);
-
if (context)
rtnl = sd_netlink_ref(context);
else {
n_list++;
};
- typesafe_qsort(list, n_list, address_compare);
-
- *ret = TAKE_PTR(list);
+ if (ret) {
+ typesafe_qsort(list, n_list, address_compare);
+ *ret = TAKE_PTR(list);
+ }
return (int) n_list;
}
size_t n_list = 0, n_allocated = 0;
int r;
- assert(ret);
-
if (context)
rtnl = sd_netlink_ref(context);
else {
}
}
- typesafe_qsort(list, n_list, address_compare);
-
- *ret = TAKE_PTR(list);
+ if (ret) {
+ typesafe_qsort(list, n_list, address_compare);
+ *ret = TAKE_PTR(list);
+ }
return (int) n_list;
}