Revert "lib: Make iscsi_realloc() update the freed pointer list"

iscsi_realloc MUST NOT be called with a pointer that is in the freelist
of small allocations. First they are free and secondly a realloc
will change the size of the small allocation to an unknown size.

This reverts commit d8de6531f8.
This commit is contained in:
Peter Lieven
2015-04-23 14:12:57 +02:00
parent cf4076dba9
commit 52a6bdb774

View File

@@ -60,19 +60,10 @@ void* iscsi_zmalloc(struct iscsi_context *iscsi, size_t size) {
}
void* iscsi_realloc(struct iscsi_context *iscsi, void* ptr, size_t size) {
int i;
void * _ptr = realloc(ptr, size);
if (_ptr != NULL) {
iscsi->reallocs++;
}
if (ptr != NULL) {
for (i = 0; i < iscsi->smalloc_free; i++) {
if (iscsi->smalloc_ptrs[i] == ptr) {
iscsi->smalloc_ptrs[i] = _ptr;
break;
}
}
}
return _ptr;
}