commit 02b786ac6c63da345c297bf47563d00985dedcb6
parent bd20bcb8514e6ba476aa608197c97f2614196682
Author: Quentin Rameau <quinq@fifth.space>
Date: Fri, 23 Jun 2017 20:50:43 +0200
Fix xreallocarray error check
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sacc.c b/sacc.c
@@ -53,7 +53,7 @@ xreallocarray(void *m, const size_t n, const size_t s)
errno = 0;
if (s && n > (size_t)-1/s)
die("realloc: overflow");
- if (!(nm = realloc(m, n * s)))
+ if (!(nm = realloc(m, n * s)) && errno)
die("realloc: %s", strerror(errno));
return nm;