diff options
| author | Toomas Soome <tsoome@FreeBSD.org> | 2019-09-17 09:47:35 +0000 |
|---|---|---|
| committer | Toomas Soome <tsoome@FreeBSD.org> | 2019-09-17 09:47:35 +0000 |
| commit | 144c4ca0398fc9cb2c7e602baba7009871ef8ce8 (patch) | |
| tree | 2b8329eb30a482f361d8c6ae441df8bab839bcbd /stand/libsa/zalloc_malloc.c | |
| parent | 3c193115440ea21d7811c20326488be4346ed4a2 (diff) | |
Notes
Diffstat (limited to 'stand/libsa/zalloc_malloc.c')
| -rw-r--r-- | stand/libsa/zalloc_malloc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/stand/libsa/zalloc_malloc.c b/stand/libsa/zalloc_malloc.c index 2cc14d80641d..f0eddb123178 100644 --- a/stand/libsa/zalloc_malloc.c +++ b/stand/libsa/zalloc_malloc.c @@ -156,7 +156,9 @@ Realloc(void *ptr, size_t size, const char *file, int line) if ((res = Malloc(size, file, line)) != NULL) { if (ptr) { - old = *(size_t *)((char *)ptr - MALLOCALIGN) - MALLOCALIGN; + Guard *g = (Guard *)((char *)ptr - MALLOCALIGN); + + old = g->ga_Bytes - MALLOCALIGN; if (old < size) bcopy(ptr, res, old); else |
