epi_iter_new(): Use xrealloc().
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 13 May 2018 15:27:07 +0000 (17:27 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 20 Jan 2019 11:05:22 +0000 (12:05 +0100)
This way we get proper error checking.

tfortune.c

index 7e59eb6..0768976 100644 (file)
@@ -335,7 +335,7 @@ static struct epi_iter *epi_iter_new(void)
                        regfile_iter_next(riter)
                ) {
                        eiter->num_maps++;
-                       eiter->maps = realloc(eiter->maps,
+                       eiter->maps = xrealloc(eiter->maps,
                                eiter->num_maps * sizeof(*eiter->maps));
                        eiter->maps[eiter->num_maps - 1] = iov;
                }