1
From: Daniel Veillard <veillard@redhat.com>
2
Date: Thu, 11 Jul 2013 15:41:22 +0800
3
Subject: Catch malloc error and exit accordingly
5
As pointed privately by Bill Parker <wp02855@gmail.com>
8
1 file changed, 4 insertions(+)
10
diff --git a/xmllint.c b/xmllint.c
11
index c0196ab..4d464e4 100644
14
@@ -3090,6 +3090,10 @@ static void usage(const char *name) {
15
static void registerNode(xmlNodePtr node)
17
node->_private = malloc(sizeof(long));
18
+ if (node->_private == NULL) {
19
+ fprintf(stderr, "Out of memory in xmllint:registerNode()\n");
20
+ exit(XMLLINT_ERR_MEM);
22
*(long*)node->_private = (long) 0x81726354;