diff options
author | Sebastian Pipping <sebastian@pipping.org> | 2022-10-24 02:04:45 +0200 |
---|---|---|
committer | Sebastian Pipping <sebastian@pipping.org> | 2022-10-24 16:00:45 +0200 |
commit | 77409cde885f54d9a8be4a18ec5b88c0935cc8bb (patch) | |
tree | bf91a2859d82d42a4b81f482acfb0cb904bdb4da /expat/examples | |
parent | 894b98d9b39a5ffa26caaff4cc9444c14642cb87 (diff) | |
download | libexpat-git-77409cde885f54d9a8be4a18ec5b88c0935cc8bb.tar.gz |
examples/elements.c: Be consistent across examples regarding OOM detection
Diffstat (limited to 'expat/examples')
-rw-r--r-- | expat/examples/elements.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/expat/examples/elements.c b/expat/examples/elements.c index a2673d37..f0497ece 100644 --- a/expat/examples/elements.c +++ b/expat/examples/elements.c @@ -82,6 +82,11 @@ main(void) { int done; int depth = 0; + if (! parser) { + fprintf(stderr, "Couldn't allocate memory for parser\n"); + return 1; + } + XML_SetUserData(parser, &depth); XML_SetElementHandler(parser, startElement, endElement); do { |