Zero out mset memory in one fell swoop

This commit is contained in:
lericson 2010-05-10 13:23:20 +02:00
parent eb21e83e2c
commit 2ff9e471c2

View File

@ -478,20 +478,7 @@ static PyObject *_PylibMC_RunSetCommandMulti(PylibMC_Client* self,
goto cleanup; goto cleanup;
} }
for(idx = 0; idx < nkeys; idx++) { memset((void *)serialized, 0x0, nkeys * sizeof(pylibmc_mset));
/* init them all with NULL pointers so that we can reliably detect
and free the ones that get allocated */
serialized[idx].key = NULL;
serialized[idx].key_len = 0;
serialized[idx].value = NULL;
serialized[idx].value_len = 0;
serialized[idx].time = 0;
serialized[idx].flags = PYLIBMC_FLAG_NONE;
serialized[idx].key_obj = NULL;
serialized[idx].prefixed_key_obj = NULL;
serialized[idx].value_obj = NULL;
serialized[idx].success = false;
}
/* we're pointing into existing Python memory with the 'key' members /* we're pointing into existing Python memory with the 'key' members
of pylibmc_mset (extracted using PyDict_Next) and during of pylibmc_mset (extracted using PyDict_Next) and during