git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3458 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2006-11-26 20:06:04 +00:00
parent 57dd6da1fe
commit dd1f941744
1 changed files with 9 additions and 9 deletions

View File

@ -1196,19 +1196,19 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel
return in;
}
}
nlen = sub_val ? strlen(sub_val) : 0;
if ((nlen = sub_val ? strlen(sub_val) : 0)) {
if (len + nlen >= olen) {
olen = (olen + len + nlen + block);
cpos = c - data;
data = realloc(data, olen);
c = data + cpos;
memset(c, 0, olen - cpos);
}
if (len + nlen >= olen) {
olen = (olen + len + nlen + block);
cpos = c - data;
data = realloc(data, olen);
c = data + cpos;
memset(c, 0, olen - cpos);
}
if (nlen) {
len += nlen;
strcat(c, sub_val);
c += nlen;
}
switch_safe_free(func_val);