initialize the dynamic string in a sane way.
authorLuigi Rizzo <rizzo@icir.org>
Tue, 28 Nov 2006 15:53:12 +0000 (15:53 +0000)
committerLuigi Rizzo <rizzo@icir.org>
Tue, 28 Nov 2006 15:53:12 +0000 (15:53 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48086 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/manager.c

index 1c4d2c1..5791916 100644 (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);