initialize the dynamic string in a sane way.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Luigi Rizzo
2006-11-28 15:53:12 +00:00
parent 5e7aebf9ac
commit 3dbc33ed4f

View File

@@ -2770,7 +2770,7 @@ static char *generic_http_callback(enum output_format format,
/* always return something even if len == 0 */
if ((buf = ast_calloc(1, len+1))) {
if (!s->outputstr)
s->outputstr = ast_calloc(1, sizeof(*s->outputstr));
s->outputstr = ast_dynamic_str_create(len+1);
if (len > 0 && s->outputstr) {
lseek(s->fd, 0, SEEK_SET);
read(s->fd, buf, len);