summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2015-10-26 14:27:26 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2015-10-26 14:27:26 -0700
commit81fa9fd25a57ebaf7e242bc678a6fd179bbdb718 (patch)
tree4bad551e3f23807a1189dc9349442ff18b63dedc
parent609273875d3fb911c20806aeb7c4d558e698a7f2 (diff)
downloadzsh-81fa9fd25a57ebaf7e242bc678a6fd179bbdb718.tar.gz
zsh-81fa9fd25a57ebaf7e242bc678a6fd179bbdb718.zip
36906: quite_signals() in ZSH_MEM realloc()
-rw-r--r--ChangeLog3
-rw-r--r--Src/mem.c9
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index df70cbd45..bdd27871d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2015-10-26 Barton E. Schaefer <schaefer@zsh.org>
+ * 36906: Kamil Dudka <kdudka@redhat.com>: Src/mem.c:
+ quite_signals() in ZSH_MEM realloc()
+
* 36968: Src/Modules/db_gdbm.c: use addmodulefd() to tell the
shell about the descriptor of the dbm file
diff --git a/Src/mem.c b/Src/mem.c
index 3138bb1d5..62d18d0cd 100644
--- a/Src/mem.c
+++ b/Src/mem.c
@@ -1668,8 +1668,13 @@ realloc(MALLOC_RET_T p, MALLOC_ARG_T size)
int i, l = 0;
/* some system..., see above */
- if (!p && size)
- return (MALLOC_RET_T) malloc(size);
+ if (!p && size) {
+ queue_signals();
+ r = malloc(size);
+ unqueue_signals();
+ return (MALLOC_RET_T) r;
+ }
+
/* and some systems even do this... */
if (!p || !size)
return (MALLOC_RET_T) p;