more coverity fixes

master
Andre Puschmann 7 years ago
parent 07cd9ae528
commit e5a04844ec

@ -82,6 +82,7 @@ bool read(std::string filename) {
written[thread][msg] = true; written[thread][msg] = true;
} else { } else {
perror("Wrong thread and/or msg"); perror("Wrong thread and/or msg");
fclose(f);
return false; return false;
} }
} }

@ -591,7 +591,7 @@ int main(int argc, char *argv[])
int setup_if_addr(char *ip_addr) int setup_if_addr(char *ip_addr)
{ {
char *dev = (char*) "tun_srsenb"; char *dev = (char*) "tun_srsenb";
int sock = 0; int sock;
// Construct the TUN device // Construct the TUN device
int tun_fd = open("/dev/net/tun", O_RDWR); int tun_fd = open("/dev/net/tun", O_RDWR);
@ -642,10 +642,12 @@ int setup_if_addr(char *ip_addr)
perror("ioctl"); perror("ioctl");
goto clean_exit; goto clean_exit;
} }
shutdown(sock, SHUT_RDWR);
return(tun_fd); return(tun_fd);
clean_exit: clean_exit:
shutdown(sock, SHUT_RDWR);
close(tun_fd); close(tun_fd);
return SRSLTE_ERROR; return SRSLTE_ERROR;
} }

Loading…
Cancel
Save