summaryrefslogtreecommitdiff
path: root/main/translate.c
diff options
context:
space:
mode:
authorSean Bright <sean@malleable.com>2013-01-01 17:10:42 +0000
committerSean Bright <sean@malleable.com>2013-01-01 17:10:42 +0000
commitcdf84987841ad22b9d3f6b7dec24c4e777debca2 (patch)
tree9b7187b51a523206c5929b92be0cb2118d52b436 /main/translate.c
parent9c20603dfcf9c4d4cc355c7a68a383640556fc2c (diff)
Revert 378248. I changed the logic of this function unitentionally, pointed out by file.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378249 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/translate.c')
-rw-r--r--main/translate.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/main/translate.c b/main/translate.c
index ac9112e81..ce430ce97 100644
--- a/main/translate.c
+++ b/main/translate.c
@@ -283,12 +283,6 @@ static void *newpvt(struct ast_translator *t, const struct ast_format *explicit_
int len;
char *ofs;
- /* If we don't have a local init routine, don't bother building the
- ast_trans_pvt */
- if (!t->newpvt) {
- return NULL;
- }
-
/*
* compute the required size adding private descriptor,
* buffer, AST_FRIENDLY_OFFSET.
@@ -315,7 +309,7 @@ static void *newpvt(struct ast_translator *t, const struct ast_format *explicit_
ast_format_copy(&pvt->explicit_dst, explicit_dst);
}
/* call local init routine, if present */
- if (t->newpvt(pvt)) {
+ if (t->newpvt && t->newpvt(pvt)) {
ast_free(pvt);
return NULL;
}