mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
Merge pull request #16997 from poettering/foreach-word-followup
fix two coverity issues
This commit is contained in:
@@ -1064,7 +1064,7 @@ static void socket_apply_socket_options(Socket *s, int fd) {
|
||||
}
|
||||
|
||||
if (s->send_buffer > 0) {
|
||||
r = fd_set_sndbuf(fd, s->receive_buffer, false);
|
||||
r = fd_set_sndbuf(fd, s->send_buffer, false);
|
||||
if (r < 0)
|
||||
log_unit_warning_errno(UNIT(s), r, "SO_SNDBUF/SO_SNDBUFFORCE failed: %m");
|
||||
}
|
||||
|
||||
@@ -916,14 +916,14 @@ _public_ int sd_machine_get_ifindices(const char *machine, int **ret_ifindices)
|
||||
if (!tt)
|
||||
return -ENOMEM;
|
||||
|
||||
size_t n = 0;
|
||||
int *ifindices;
|
||||
_cleanup_free_ int *ifindices = NULL;
|
||||
if (ret_ifindices) {
|
||||
ifindices = new(int, strv_length(tt));
|
||||
if (!ifindices)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
size_t n = 0;
|
||||
for (size_t i = 0; tt[i]; i++) {
|
||||
int ind;
|
||||
|
||||
@@ -938,7 +938,8 @@ _public_ int sd_machine_get_ifindices(const char *machine, int **ret_ifindices)
|
||||
}
|
||||
|
||||
if (ret_ifindices)
|
||||
*ret_ifindices = ifindices;
|
||||
*ret_ifindices = TAKE_PTR(ifindices);
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user