2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 22:45:39 +00:00

Remove blocks checking whether isc_mem_get() failed using the coccinelle

This commit is contained in:
Ondřej Surý
2019-07-16 15:52:14 +02:00
parent f63e696967
commit ae83801e2b
133 changed files with 151 additions and 1717 deletions

View File

@@ -546,14 +546,8 @@ isc_buffer_allocate(isc_mem_t *mctx, isc_buffer_t **dynbuffer,
REQUIRE(*dynbuffer == NULL);
dbuf = isc_mem_get(mctx, sizeof(isc_buffer_t));
if (dbuf == NULL)
return (ISC_R_NOMEMORY);
bdata = isc_mem_get(mctx, length);
if (bdata == NULL) {
isc_mem_put(mctx, dbuf, sizeof(isc_buffer_t));
return (ISC_R_NOMEMORY);
}
isc_buffer_init(dbuf, bdata, length);
dbuf->mctx = mctx;
@@ -600,10 +594,7 @@ isc_buffer_reserve(isc_buffer_t **dynbuffer, unsigned int size) {
* it doesn't remap pages, but does ordinary copy. So is
* isc_mem_reallocate(), which has additional issues.
*/
bdata = isc_mem_get((*dynbuffer)->mctx, (unsigned int) len);
if (bdata == NULL) {
return (ISC_R_NOMEMORY);
}
bdata = isc_mem_get((*dynbuffer)->mctx, (unsigned int)len);
memmove(bdata, (*dynbuffer)->base, (*dynbuffer)->length);
isc_mem_put((*dynbuffer)->mctx, (*dynbuffer)->base,