From: BJ Weschke Date: Tue, 23 May 2006 15:58:24 +0000 (+0000) Subject: Fix a potential leak and correct (hopefully) a segfault under certain conditions... X-Git-Tag: 1.2.9.1~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1c97e7df814cb1de80e4ff6a6bfa735f08514af;p=thirdparty%2Fasterisk.git Fix a potential leak and correct (hopefully) a segfault under certain conditions. #6784 (vovan and perry testing) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@29696 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_features.c b/res/res_features.c index 30c00db27d..885f4a7d74 100644 --- a/res/res_features.c +++ b/res/res_features.c @@ -1433,6 +1433,9 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast featurecode = peer_featurecode; } featurecode[strlen(featurecode)] = f->subclass; + /* Get rid of the frame before we start doing "stuff" with the channels */ + ast_frfree(f); + f = NULL; config->feature_timer = backup_config.feature_timer; res = ast_feature_interpret(chan, peer, config, featurecode, sense); switch(res) { @@ -1445,10 +1448,8 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast } if (res >= FEATURE_RETURN_PASSDIGITS) { res = 0; - } else { - ast_frfree(f); + } else break; - } hasfeatures = !ast_strlen_zero(chan_featurecode) || !ast_strlen_zero(peer_featurecode); if (hadfeatures && !hasfeatures) { /* Restore backup */