[asterisk-commits] rizzo: branch 1.4 r45464 - /branches/1.4/main/http.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Oct 17 21:09:51 MST 2006


Author: rizzo
Date: Tue Oct 17 23:09:50 2006
New Revision: 45464

URL: http://svn.digium.com/view/asterisk?rev=45464&view=rev
Log:
merge from trunk: move ast_variables_destroy() to a better
place in handle_uri() to avoid leaking memory on non existing files.


Modified:
    branches/1.4/main/http.c

Modified: branches/1.4/main/http.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/http.c?rev=45464&r1=45463&r2=45464&view=diff
==============================================================================
--- branches/1.4/main/http.c (original)
+++ branches/1.4/main/http.c Tue Oct 17 23:09:50 2006
@@ -337,7 +337,6 @@
 	}
 	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 @@
 		*status = 404;
 		*title = strdup("Not Found");
 	}
+	ast_variables_destroy(vars);
 	return c;
 }
 



More information about the asterisk-commits mailing list