diff options
author | Joshua Colp <jcolp@digium.com> | 2017-12-20 07:01:01 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-12-20 07:01:01 -0600 |
commit | f1d50c0fb0e5dbdb77c89a559bee3324d22b49a6 (patch) | |
tree | 95db1675f0323ef64474a4ccc1efc5ee35a5759d | |
parent | eda4f59656c448be827cd68d19a87ac197b6d526 (diff) | |
parent | 381ed4f1cc91069c8c17d55c0665741a2b8f476f (diff) |
Merge "core: Fix multiple trivial issues in the core." into 13
-rw-r--r-- | main/translate.c | 5 | ||||
-rw-r--r-- | main/utils.c | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/main/translate.c b/main/translate.c index 4ffe27c33..0721f07b0 100644 --- a/main/translate.c +++ b/main/translate.c @@ -499,6 +499,7 @@ struct ast_trans_pvt *ast_translator_build_path(struct ast_format *dst, struct a ast_log(LOG_WARNING, "No translator path from %s to %s\n", ast_format_get_name(src), ast_format_get_name(dst)); AST_RWLIST_UNLOCK(&translators); + ast_translator_free_path(head); return NULL; } if ((t->dst_codec.sample_rate == ast_format_get_sample_rate(dst)) && (t->dst_codec.type == ast_format_get_type(dst))) { @@ -507,9 +508,7 @@ struct ast_trans_pvt *ast_translator_build_path(struct ast_format *dst, struct a if (!(cur = newpvt(t, explicit_dst))) { ast_log(LOG_WARNING, "Failed to build translator step from %s to %s\n", ast_format_get_name(src), ast_format_get_name(dst)); - if (head) { - ast_translator_free_path(head); - } + ast_translator_free_path(head); AST_RWLIST_UNLOCK(&translators); return NULL; } diff --git a/main/utils.c b/main/utils.c index 0b8dc7aeb..b4ecffd7e 100644 --- a/main/utils.c +++ b/main/utils.c @@ -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; |