fix a mem leak (bug #4154)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@5799 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2005-05-31 04:39:24 +00:00
parent a6e8158ddc
commit 2995096956

View File

@@ -1237,7 +1237,7 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state)
struct ast_channel *tmp;
struct mgcp_endpoint *i = sub->parent;
int fmt;
i = sub->parent;
tmp = ast_channel_alloc(1);
if (tmp) {
tmp->nativeformats = i->capability;
@@ -1677,11 +1677,10 @@ static int process_sdp(struct mgcp_subchannel *sub, struct mgcp_request *req)
specified RTP payload type (with corresponding MIME subtype): */
sdpLineNum_iterator_init(&iterator);
while ((a = get_sdp_iterate(&iterator, req, "a"))[0] != '\0') {
char* mimeSubtype = strdup(a); // ensures we have enough space
char* mimeSubtype = ast_strdupa(a); /* ensures we have enough space */
if (sscanf(a, "rtpmap: %u %[^/]/", &codec, mimeSubtype) != 2) continue;
/* Note: should really look at the 'freq' and '#chans' params too */
ast_rtp_set_rtpmap_type(sub->rtp, codec, "audio", mimeSubtype);
free(mimeSubtype);
}
/* Now gather all of the codecs that were asked for: */