diff --git a/ChangeLog b/ChangeLog index 893b16e2c..ee314487c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2016-11-11 Daniel Shahaf + * 39874/0002 plus size=0 handling: Src/mem.c: zshcalloc: Remove + code duplication. No functional change. + * 39874/0001: Src/params.c: setarrvalue: Remove needless initialization. diff --git a/Src/mem.c b/Src/mem.c index 8c7eb8017..840bbb6e4 100644 --- a/Src/mem.c +++ b/Src/mem.c @@ -976,18 +976,10 @@ zalloc(size_t size) mod_export void * zshcalloc(size_t size) { - void *ptr; - + void *ptr = zalloc(size); if (!size) size = 1; - queue_signals(); - if (!(ptr = (void *) malloc(size))) { - zerr("fatal error: out of memory"); - exit(1); - } - unqueue_signals(); memset(ptr, 0, size); - return ptr; }