1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

nmbd: Fix socket cleanup in make_subnet()

We can have -errno in the in those variables

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2021-03-23 11:58:58 +01:00 committed by Jeremy Allison
parent 7d25dfa6c1
commit 263e6e06bd

View File

@ -196,16 +196,16 @@ static struct subnet_record *make_subnet(const char *name, enum subnet_type type
failed:
SAFE_FREE(subrec);
if (nmb_sock != -1) {
if (nmb_sock >= 0) {
close(nmb_sock);
}
if (nmb_bcast != -1) {
if (nmb_bcast >= 0) {
close(nmb_bcast);
}
if (dgram_sock != -1) {
if (dgram_sock >= 0) {
close(dgram_sock);
}
if (dgram_bcast != -1) {
if (dgram_bcast >= 0) {
close(dgram_bcast);
}
return NULL;