commit | e71dce18a1a72578581d4e91c24a44eead0d5949 | [log] [tgz] |
---|---|---|
author | Daniel Veillard <veillard@redhat.com> | Thu Jul 11 15:41:22 2013 +0800 |
committer | Daniel Veillard <veillard@redhat.com> | Thu Jul 11 15:41:22 2013 +0800 |
tree | 11dec12eeb840654bda91411504e29651f8b3ba2 | |
parent | 6c9c611beed57f001ca3ae6b964518d9c7336a69 [diff] |
Catch malloc error and exit accordingly As pointed privately by Bill Parker <wp02855@gmail.com>
diff --git a/xmllint.c b/xmllint.c index c0196ab..4d464e4 100644 --- a/xmllint.c +++ b/xmllint.c
@@ -3090,6 +3090,10 @@ static void registerNode(xmlNodePtr node) { node->_private = malloc(sizeof(long)); + if (node->_private == NULL) { + fprintf(stderr, "Out of memory in xmllint:registerNode()\n"); + exit(XMLLINT_ERR_MEM); + } *(long*)node->_private = (long) 0x81726354; nbregister++; }