Switch to vasprintf (big #398) dropping bogus free()
authorMark Spencer <markster@digium.com>
Wed, 22 Oct 2003 03:52:56 +0000 (03:52 +0000)
committerMark Spencer <markster@digium.com>
Wed, 22 Oct 2003 03:52:56 +0000 (03:52 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1651 65c4cc65-6c06-0410-ace0-fbb531ad65f3

cli.c

diff --git a/cli.c b/cli.c
index 7e44555..d577943 100755 (executable)
--- a/cli.c
+++ b/cli.c
        
 void ast_cli(int fd, char *fmt, ...)
 {
        
 void ast_cli(int fd, char *fmt, ...)
 {
-       char stuff[4096];
+       char *stuff;
        va_list ap;
        va_start(ap, fmt);
        va_list ap;
        va_start(ap, fmt);
-       vsnprintf(stuff, sizeof(stuff), fmt, ap);
+       vasprintf(&stuff, fmt, ap);
        va_end(ap);
        write(fd, stuff, strlen(stuff));
 }
        va_end(ap);
        write(fd, stuff, strlen(stuff));
 }