Commit 0900c193 authored by Pekka Pessi's avatar Pekka Pessi
Browse files

Fixed buglets in su/su_alloc.c.

su_alloc() did zero memory. su_realloc() used su_alloc().

parent bc94179f
......@@ -603,7 +603,7 @@ void *su_alloc(su_home_t *home, int size)
void *data;
if (home) {
data = sub_alloc(home, MEMLOCK(home), size, 1);
data = sub_alloc(home, MEMLOCK(home), size, 0);
......@@ -1011,17 +1011,19 @@ void *su_realloc(su_home_t *home, void *data, int size)
return NULL;
if (!data)
return su_alloc(home, size);
sub = MEMLOCK(home);
if (!data) {
data = sub_alloc(home, sub, size, 0);
return data;
sua = su_block_find(sub, data);
if (!su_alloc_check(sub, sua))
return UNLOCK(home);
if (sua->sua_home)
return UNLOCK(home);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment