]> git.tue.mpg.de Git - tfortune.git/commitdiff
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 7e59eb69e39c2872d715ce5f0aff71fb65c06011..0768976bfb83e8519aa29eab9ce40dfbb16a6413 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;
                }