Skip to content

Commit fd16a77

Browse files
committed
mdns: do not close an fd that is not open
Coverity: CID 739656 (#5 of 14): Argument cannot be negative (NEGATIVE_RETURNS) At (8): "encapsulatingSkfd" is passed to a parameter that cannot be negative. CID 739656 (#7-8 of 14): Argument cannot be negative (NEGATIVE_RETURNS) At (10): "encapsulatingSkfd" is passed to a parameter that cannot be negative. Signed-off-by: Ferry Huberts <[email protected]>
1 parent bbc9639 commit fd16a77

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

lib/mdns/src/NetworkInterfaces.c

-2
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,6 @@ CreateInterface(const char *ifName, struct interface *olsrIntf)
464464
electionSkfd = CreateRouterElectionSocket(ifName);
465465
helloSkfd = CreateHelloSocket(ifName);
466466
if (capturingSkfd < 0 || electionSkfd < 0 || helloSkfd < 0) {
467-
close(encapsulatingSkfd);
468467
close(capturingSkfd);
469468
close(electionSkfd);
470469
close(helloSkfd);
@@ -486,7 +485,6 @@ CreateInterface(const char *ifName, struct interface *olsrIntf)
486485
if (ioctl(ioctlSkfd, SIOCGIFHWADDR, &ifr) < 0) {
487486
BmfPError("ioctl(SIOCGIFHWADDR) error for interface \"%s\"", ifName);
488487
close(capturingSkfd);
489-
close(encapsulatingSkfd);
490488
close(electionSkfd);
491489
close(helloSkfd);
492490
free(newIf);

0 commit comments

Comments
 (0)