Ticket #1923: ngx_inet.c.patch
| File ngx_inet.c.patch, 1.7 KB (added by , 6 years ago) |
|---|
-
ngx_inet.c
old new 751 751 752 752 saun = ngx_pcalloc(pool, sizeof(struct sockaddr_un)); 753 753 if (saun == NULL) { 754 ngx_pfree(u->addrs); /* release memory from u->addrs */ 754 755 return NGX_ERROR; 755 756 } 756 757 … … 913 914 914 915 sin = ngx_pcalloc(pool, sizeof(struct sockaddr_in)); 915 916 if (sin == NULL) { 917 ngx_pfree(u->addrs); /* release memory from u->addrs */ 916 918 return NGX_ERROR; 917 919 } 918 920 … … 1070 1072 1071 1073 sin6 = ngx_pcalloc(pool, sizeof(struct sockaddr_in6)); 1072 1074 if (sin6 == NULL) { 1075 ngx_pfree(u->addrs); /* release memory from u->addrs */ 1073 1076 return NGX_ERROR; 1074 1077 } 1075 1078 … … 1296 1299 1297 1300 sin = ngx_pcalloc(pool, sizeof(struct sockaddr_in)); 1298 1301 if (sin == NULL) { 1302 ngx_pfree(u->addrs); /* release memory allocated to u->addrs */ 1299 1303 return NGX_ERROR; 1300 1304 } 1301 1305 … … 1310 1314 1311 1315 p = ngx_pnalloc(pool, len); 1312 1316 if (p == NULL) { 1317 ngx_pfree(sin); /* release memory allocated to sin */ 1318 ngx_pfree(u->addrs); /* release memory allocated to u->addrs */ 1313 1319 return NGX_ERROR; 1314 1320 } 1315 1321 … … 1331 1337 1332 1338 sin = ngx_pcalloc(pool, sizeof(struct sockaddr_in)); 1333 1339 if (sin == NULL) { 1340 ngx_pfree(u->addrs); /* release memory assigned to u->addrs */ 1334 1341 return NGX_ERROR; 1335 1342 } 1336 1343 … … 1345 1352 1346 1353 p = ngx_pnalloc(pool, u->host.len + sizeof(":65535") - 1); 1347 1354 if (p == NULL) { 1355 ngx_pfree(sin); /* release memory assigned to sin */ 1356 ngx_pfree(u->addrs); /* release memory assigned to u->addrs */ 1348 1357 return NGX_ERROR; 1349 1358 } 1350 1359
