aboutsummaryrefslogtreecommitdiffstats
path: root/src/zstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/zstr.c')
-rw-r--r--src/zstr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/zstr.c b/src/zstr.c
index 308c7ef..6a577b9 100644
--- a/src/zstr.c
+++ b/src/zstr.c
@@ -81,7 +81,7 @@ zstr(z_t a, char *b, size_t n)
n = zstr_length(a, 10);
}
- if (unlikely(!b) && unlikely(!(b = malloc(n + 1))))
+ if (unlikely(!b) && unlikely(!(b = libzahl_temp_allocation = malloc(n + 1))))
libzahl_memfailure();
neg = znegative(a);
@@ -111,5 +111,6 @@ zstr(z_t a, char *b, size_t n)
}
}
+ libzahl_temp_allocation = 0;
return b - neg;
}