diff options
| author | Daniel Shahaf <d.s@daniel.shahaf.name> | 2016-11-08 15:46:40 +0000 |
|---|---|---|
| committer | Daniel Shahaf <d.s@daniel.shahaf.name> | 2016-11-11 04:37:59 +0000 |
| commit | c238057ccc8b1bf97c3063e93ebdeec3b8ef10b1 (patch) | |
| tree | 95aca94bf1368b78acd451328eb2ff5d15185830 /Src/mem.c | |
| parent | 39874/0001: setarrvalue: Remove needless initialization. (diff) | |
| download | zsh-c238057ccc8b1bf97c3063e93ebdeec3b8ef10b1.tar zsh-c238057ccc8b1bf97c3063e93ebdeec3b8ef10b1.tar.gz zsh-c238057ccc8b1bf97c3063e93ebdeec3b8ef10b1.tar.bz2 zsh-c238057ccc8b1bf97c3063e93ebdeec3b8ef10b1.tar.lz zsh-c238057ccc8b1bf97c3063e93ebdeec3b8ef10b1.tar.xz zsh-c238057ccc8b1bf97c3063e93ebdeec3b8ef10b1.tar.zst zsh-c238057ccc8b1bf97c3063e93ebdeec3b8ef10b1.zip | |
39874/0002 plus size=0 handling: zshcalloc: Remove code duplication. No functional change.
Diffstat (limited to 'Src/mem.c')
| -rw-r--r-- | Src/mem.c | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -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; } |
