mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-19 00:00:09 +00:00
ouch! remember to unlink temporary files once done with them.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2413,6 +2413,7 @@ static char *generic_http_callback(enum output_format format,
|
|||||||
char *retval = NULL;
|
char *retval = NULL;
|
||||||
struct message m;
|
struct message m;
|
||||||
struct ast_variable *v;
|
struct ast_variable *v;
|
||||||
|
char template[] = "/tmp/ast-http-XXXXXX"; /* template for temporary file */
|
||||||
|
|
||||||
for (v = params; v; v = v->next) {
|
for (v = params; v; v = v->next) {
|
||||||
if (!strcasecmp(v->name, "mansession_id")) {
|
if (!strcasecmp(v->name, "mansession_id")) {
|
||||||
@@ -2477,11 +2478,9 @@ static char *generic_http_callback(enum output_format format,
|
|||||||
ast_build_string(&c, &len, ROW_FMT, "<h1>Manager Tester</h1>");
|
ast_build_string(&c, &len, ROW_FMT, "<h1>Manager Tester</h1>");
|
||||||
ast_build_string(&c, &len, ROW_FMT, TEST_STRING);
|
ast_build_string(&c, &len, ROW_FMT, TEST_STRING);
|
||||||
}
|
}
|
||||||
{
|
|
||||||
char template[32];
|
s->fd = mkstemp(template); /* create a temporary file for command output */
|
||||||
ast_copy_string(template, "/tmp/ast-http-XXXXXX", sizeof(template));
|
|
||||||
s->fd = mkstemp(template);
|
|
||||||
}
|
|
||||||
if (process_message(s, &m)) {
|
if (process_message(s, &m)) {
|
||||||
if (s->authenticated) {
|
if (s->authenticated) {
|
||||||
if (option_verbose > 1) {
|
if (option_verbose > 1) {
|
||||||
@@ -2515,6 +2514,7 @@ static char *generic_http_callback(enum output_format format,
|
|||||||
}
|
}
|
||||||
close(s->fd);
|
close(s->fd);
|
||||||
s->fd = -1;
|
s->fd = -1;
|
||||||
|
unlink(template);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->outputstr) {
|
if (s->outputstr) {
|
||||||
|
|||||||
Reference in New Issue
Block a user