Completed ch01/ex19.c. Checked with valgrind; no leaks.