diff options
author | Corey Farrell <git@cfware.com> | 2017-12-19 00:17:08 -0500 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2017-12-19 00:36:24 -0500 |
commit | bf33a09c37c6eb906587827ded8ea68669baf36a (patch) | |
tree | 93c4dd1e8ef9b4ccf36b1c242da90f9e2689ff0a /main/translate.c | |
parent | 11a1e07ad291df072bccc9896f4d90efd056c1f8 (diff) |
core: Fix multiple trivial issues in the core.
* Fix small leaks in from error conditions in sdp.c and translate.c.
* Check new file descriptor is less than 0, not less than or equal.
Change-Id: Id7782775486175c739e0c4bf3ea5e17e3f452a99
Diffstat (limited to 'main/translate.c')
-rw-r--r-- | main/translate.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/main/translate.c b/main/translate.c index ce4745ce0..02717c5ed 100644 --- a/main/translate.c +++ b/main/translate.c @@ -497,6 +497,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))) { @@ -505,9 +506,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; } |