about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ring.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ring.c b/ring.c
index 620f490..5fb9daa 100644
--- a/ring.c
+++ b/ring.c
@@ -67,11 +67,11 @@ size_t ringConsumer(const char *name) {
 
 	if (consumers.len == consumers.cap) {
 		consumers.cap = (consumers.cap ? consumers.cap * 2 : 8);
-		// FIXME: Keep old pointer around for saving when exiting for error.
-		consumers.ptr = realloc(
+		void *ptr = realloc(
 			consumers.ptr, sizeof(*consumers.ptr) * consumers.cap
 		);
-		if (!consumers.ptr) err(EX_OSERR, "realloc");
+		if (!ptr) err(EX_OSERR, "realloc");
+		consumers.ptr = ptr;
 	}
 
 	struct Consumer *consumer = &consumers.ptr[consumers.len];
2ae31fafde32a8787fef11&follow=1'>Use mandoc and htagml for bin htmlJune McEnroe 2021-01-12Add htagmlJune McEnroe 2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe 2021-01-11Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe 2021-01-09Add c -t flag to print expression typeJune McEnroe 2021-01-05Update taglineJune McEnroe