core: Fix multiple trivial issues in the core.

* Fix small leaks in from error condition in translate.c.
* Check new file descriptor is less than 0, not less than or equal.

Change-Id: Id7782775486175c739e0c4bf3ea5e17e3f452a99
This commit is contained in:
Corey Farrell
2017-12-19 00:17:08 -05:00
parent b14d165927
commit 381ed4f1cc
2 changed files with 3 additions and 4 deletions

View File

@@ -2664,7 +2664,7 @@ void ast_set_default_eid(struct ast_eid *eid)
unsigned char full_mac[6] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
s = socket(AF_INET, SOCK_STREAM, 0);
if (s <= 0) {
if (s < 0) {
ast_log(LOG_WARNING, "Unable to open socket for seeding global EID. "
"You will have to set it manually.\n");
return;