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().

darcs-hash:20051102153357-65a35-223cf6c7a674456a4a24ad0b5194f55ae94d9980.gz
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);
UNLOCK(home);
}
else
......@@ -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);
UNLOCK(home);
return data;
}
sua = su_block_find(sub, data);
if (!su_alloc_check(sub, sua))
return UNLOCK(home);
assert(!sua->sua_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