[nginx] svn commit: r5159 - in branches/stable-1.2: . src/core

mdounin at mdounin.ru mdounin at mdounin.ru
Fri Mar 29 17:51:02 UTC 2013


Author: mdounin
Date: 2013-03-29 17:51:00 +0000 (Fri, 29 Mar 2013)
New Revision: 5159
URL: http://trac.nginx.org/nginx/changeset/5159/nginx

Log:
Merge of r5117, r5123: allocation errors handing during upgrade.

*) Core: guard against failed allocation during binary upgrade.
   Patch by Piotr Sikora.

*) Core: fixed resource leak if binary upgrade fails due to no memory.
   Found by Coverity (CID 992320).


Modified:
   branches/stable-1.2/
   branches/stable-1.2/src/core/nginx.c

Index: branches/stable-1.2
===================================================================
--- branches/stable-1.2	2013-03-29 17:34:45 UTC (rev 5158)
+++ branches/stable-1.2	2013-03-29 17:51:00 UTC (rev 5159)

Property changes on: branches/stable-1.2
___________________________________________________________________
Modified: svn:mergeinfo
## -1 +1 ##
-/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4741,4754,4756-4771,4775,4777-4780,4782-4785,4795,4811-4820,4822-4824,4828-4835,4840-4844,4865-4872,4885-4887,4890-4896,4913-4925,4933-4934,4939,4944-4949,4961-4969,4973-4974,4976-4994,4997,4999-5005,5011-5025,5027-5031,5066,5070-5071,5078,5082-5083,5098,5109,5113-5114,5128
+/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4741,4754,4756-4771,4775,4777-4780,4782-4785,4795,4811-4820,4822-4824,4828-4835,4840-4844,4865-4872,4885-4887,4890-4896,4913-4925,4933-4934,4939,4944-4949,4961-4969,4973-4974,4976-4994,4997,4999-5005,5011-5025,5027-5031,5066,5070-5071,5078,5082-5083,5098,5109,5113-5114,5117,5123,5128
\ No newline at end of property
Modified: branches/stable-1.2/src/core/nginx.c
===================================================================
--- branches/stable-1.2/src/core/nginx.c	2013-03-29 17:34:45 UTC (rev 5158)
+++ branches/stable-1.2/src/core/nginx.c	2013-03-29 17:51:00 UTC (rev 5159)
@@ -594,6 +594,10 @@
     var = ngx_alloc(sizeof(NGINX_VAR)
                     + cycle->listening.nelts * (NGX_INT32_LEN + 1) + 2,
                     cycle->log);
+    if (var == NULL) {
+        ngx_free(env);
+        return NGX_INVALID_PID;
+    }
 
     p = ngx_cpymem(var, NGINX_VAR "=", sizeof(NGINX_VAR));
 



More information about the nginx-devel mailing list