diff options
author | Mark Spencer <markster@digium.com> | 2005-08-03 02:07:25 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2005-08-03 02:07:25 +0000 |
commit | 2d108b88267bdd5bba47046d223b0a128c3787f8 (patch) | |
tree | c0e29da15872f7d82e2d32dca2c76ed31ae39672 | |
parent | 5c9027a293d5d00d37672c77ea26caee3b9b8a43 (diff) |
Fix vasnprintf emulation (bug #4882)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rwxr-xr-x | utils.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -617,17 +617,17 @@ int vasprintf(char **strp, const char *fmt, va_list ap) { int size; va_list ap2; + char s; *strp = NULL; va_copy(ap2, ap); - size = vsnprintf(*strp, 0, fmt, ap2); + size = vsnprintf(&s, 1, fmt, ap2); va_end(ap2); *strp = malloc(size + 1); if (!*strp) return -1; - va_start(fmt, ap); vsnprintf(*strp, size + 1, fmt, ap); - va_end(ap); + free(*strp); return size; } |