[nginx] svn commit: r4893 - trunk/src/core

mdounin at mdounin.ru mdounin at mdounin.ru
Wed Oct 24 14:07:09 UTC 2012


Author: mdounin
Date: 2012-10-24 14:07:08 +0000 (Wed, 24 Oct 2012)
New Revision: 4893
URL: http://trac.nginx.org/nginx/changeset/4893/nginx

Log:
Resolver: added missing memory allocation error handling.


Modified:
   trunk/src/core/ngx_resolver.c

Modified: trunk/src/core/ngx_resolver.c
===================================================================
--- trunk/src/core/ngx_resolver.c	2012-10-23 14:36:18 UTC (rev 4892)
+++ trunk/src/core/ngx_resolver.c	2012-10-24 14:07:08 UTC (rev 4893)
@@ -2144,6 +2144,10 @@
 
     dst = ngx_resolver_alloc(r, n * sizeof(in_addr_t));
 
+    if (dst == NULL) {
+        return dst;
+    }
+
     j = ngx_random() % n;
 
     if (j == 0) {



More information about the nginx-devel mailing list