Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions lib/dialects/freebsd/dsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ static int cmp_xinpcb_sock_pcb(const void *a, const void *b) {
return 0;
}

/* PCB buffers are owned by the caller, including on failure. */
static int get_unix_pcbs(const char *name, struct xunpcb **pcbs,
size_t *n_pcbs) {
size_t len;
Expand Down Expand Up @@ -149,8 +150,6 @@ static int get_unix_pcbs(const char *name, struct xunpcb **pcbs,
end:
*pcbs = (struct xunpcb *)buffer;
*n_pcbs = count;
if (ret)
free(buffer);
return ret;
}

Expand Down Expand Up @@ -181,8 +180,6 @@ static int get_tcp_pcbs(struct xtcpcb **pcbs, size_t *n_pcbs) {
end:
*pcbs = (struct xtcpcb *)buffer;
*n_pcbs = count;
if (ret)
free(buffer);
return ret;
}

Expand Down Expand Up @@ -213,9 +210,7 @@ static int get_udp_pcbs(struct xinpcb **pcbs, size_t *n_pcbs) {
end:
*pcbs = (struct xinpcb *)buffer;
*n_pcbs = count;
if (ret)
free(buffer);
return 0;
return ret;
}

struct pcb_lists *read_pcb_lists(void) {
Expand Down
Loading