aboutsummaryrefslogtreecommitdiffstats
path: root/main/http.c
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-18 04:09:50 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-18 04:09:50 +0000
commitfddc96588f8e7b58ad8a6e41564498d8244e0395 (patch)
tree84f8ae210ebea7e6120420a5bf0423aac55851c5 /main/http.c
parent6488b9e10fac00330bc0c9f69034b553269cbc48 (diff)
merge from trunk: move ast_variables_destroy() to a better
place in handle_uri() to avoid leaking memory on non existing files. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@45464 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/http.c')
-rw-r--r--main/http.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/http.c b/main/http.c
index 1b7e08a66..0c0a6d974 100644
--- a/main/http.c
+++ b/main/http.c
@@ -337,7 +337,6 @@ static char *handle_uri(struct sockaddr_in *sin, char *uri, int *status, char **
}
if (urih) {
c = urih->callback(sin, uri, vars, status, title, contentlength);
- ast_variables_destroy(vars);
} else if (ast_strlen_zero(uri) && ast_strlen_zero(prefix)) {
/* Special case: If no prefix, and no URI, send to /static/index.html */
c = ast_http_error(302, "Moved Temporarily", "Location: /static/index.html\r\n", "This is not the page you are looking for...");
@@ -348,6 +347,7 @@ static char *handle_uri(struct sockaddr_in *sin, char *uri, int *status, char **
*status = 404;
*title = strdup("Not Found");
}
+ ast_variables_destroy(vars);
return c;
}