agraph, agstrdup(_html)?: Fixed potential null pointer dereferences.
The case where malloc() returns NULL was not checked, leading to the return value always being dereferenced. In libraries, such allocation functions usually just return NULL on failure and the caller is expected to check the return value before proceeding. This does not appear to be the case for the graphviz library, which just calls exit(1), e.g. in agallocu(). While such behavior can unexpectedly exit(1) any program using this library, I still opted to use exit(1) instead of returning NULL for consistency, and because some callers in graphviz always expect these functions to succeed (not checking the return value). It is better to exit with exit(1) than with a null pointer dereference error, because at least the atexit() and similar handlers will be run.
Showing with 8 additions and 2 deletions