Index: main/manager.c =================================================================== --- main/manager.c (revision 71577) +++ main/manager.c (working copy) @@ -1638,6 +1638,13 @@ l = lseek(fd, 0, SEEK_END); /* how many chars available */ buf = alloca(l + 1); final_buf = alloca(l + 1); + if (!buf || !final_buf) { + ast_log( LOG_DEBUG, "action_command: unable to allocate buffers(%ld)\n", (long) l ); + astman_append(s, "--END COMMAND--\r\n\r\n"); + close(fd); + unlink(template); + return -1; + } lseek(fd, 0, SEEK_SET); read(fd, buf, l); buf[l] = '\0';