summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2016-11-08 15:46:40 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2016-11-11 04:37:59 +0000
commitc238057ccc8b1bf97c3063e93ebdeec3b8ef10b1 (patch)
tree95aca94bf1368b78acd451328eb2ff5d15185830 /Src
parent7139b737246a75b8c08ab10124a0131bddc0ca04 (diff)
downloadzsh-c238057ccc8b1bf97c3063e93ebdeec3b8ef10b1.tar.gz
zsh-c238057ccc8b1bf97c3063e93ebdeec3b8ef10b1.tar.xz
zsh-c238057ccc8b1bf97c3063e93ebdeec3b8ef10b1.zip
39874/0002 plus size=0 handling: zshcalloc: Remove code duplication. No functional change.
Diffstat (limited to 'Src')
-rw-r--r--Src/mem.c10
1 files changed, 1 insertions, 9 deletions
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;
 }