From 52a6bdb7741f6dd11cb9360f42b213bf92cde3fc Mon Sep 17 00:00:00 2001 From: Peter Lieven Date: Thu, 23 Apr 2015 14:12:57 +0200 Subject: [PATCH] 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 d8de6531f840da742f32e8355ee7af4e6dec0b5a. --- lib/init.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/init.c b/lib/init.c index ea9c5f5..54dd1b1 100644 --- a/lib/init.c +++ b/lib/init.c @@ -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; }