[svn-commits] mjordan: branch 1.8 r361803 - /branches/1.8/main/http.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Apr 10 14:57:11 CDT 2012


Author: mjordan
Date: Tue Apr 10 14:57:06 2012
New Revision: 361803

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=361803
Log:
Fix crash caused by unloading or reloading of res_http_post

When unlinking itself from the registered HTTP URIs, res_http_post could
inadvertently free all URIs registered with the HTTP server.  This patch
modifies the unregister method to only free the URI that is actually
being unregistered, as opposed to all of them.

Modified:
    branches/1.8/main/http.c

Modified: branches/1.8/main/http.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/http.c?view=diff&rev=361803&r1=361802&r2=361803
==============================================================================
--- branches/1.8/main/http.c (original)
+++ branches/1.8/main/http.c Tue Apr 10 14:57:06 2012
@@ -582,12 +582,12 @@
 	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&uris, urih, entry) {
 		if (!strcmp(urih->key, key)) {
 			AST_RWLIST_REMOVE_CURRENT(entry);
-		}
-		if (urih->dmallocd) {
-			ast_free(urih->data);
-		}
-		if (urih->mallocd) {
-			ast_free(urih);
+			if (urih->dmallocd) {
+				ast_free(urih->data);
+			}
+			if (urih->mallocd) {
+				ast_free(urih);
+			}
 		}
 	}
 	AST_RWLIST_TRAVERSE_SAFE_END;




More information about the svn-commits mailing list