@@ -58,9 +58,9 @@ static void htmlParseComment(htmlParserCtxtPtr ctxt);
58
58
* Handle a redefinition of attribute error
59
59
*/
60
60
static void
61
- htmlErrMemory (xmlParserCtxtPtr ctxt , const char * extra )
61
+ htmlErrMemory (xmlParserCtxtPtr ctxt )
62
62
{
63
- xmlErrMemory (ctxt , extra );
63
+ xmlCtxtErrMemory (ctxt );
64
64
}
65
65
66
66
/**
@@ -127,7 +127,7 @@ htmlnamePush(htmlParserCtxtPtr ctxt, const xmlChar * value)
127
127
tmp = xmlRealloc ((xmlChar * * ) ctxt -> nameTab ,
128
128
newSize * sizeof (ctxt -> nameTab [0 ]));
129
129
if (tmp == NULL ) {
130
- htmlErrMemory (ctxt , NULL );
130
+ htmlErrMemory (ctxt );
131
131
return (-1 );
132
132
}
133
133
ctxt -> nameTab = tmp ;
@@ -185,7 +185,7 @@ htmlNodeInfoPush(htmlParserCtxtPtr ctxt, htmlParserNodeInfo *value)
185
185
ctxt -> nodeInfoMax *
186
186
sizeof (ctxt -> nodeInfoTab [0 ]));
187
187
if (ctxt -> nodeInfoTab == NULL ) {
188
- htmlErrMemory (ctxt , NULL );
188
+ htmlErrMemory (ctxt );
189
189
return (0 );
190
190
}
191
191
}
@@ -343,7 +343,7 @@ htmlFindEncoding(xmlParserCtxtPtr ctxt) {
343
343
return (NULL );
344
344
ret = xmlStrndup (start , cur - start );
345
345
if (ret == NULL )
346
- htmlErrMemory (ctxt , NULL );
346
+ htmlErrMemory (ctxt );
347
347
return (ret );
348
348
}
349
349
@@ -1996,7 +1996,7 @@ static const htmlEntityDesc html40EntitiesTable[] = {
1996
1996
buffer##_size *= 2; \
1997
1997
tmp = (xmlChar *) xmlRealloc(buffer, buffer##_size); \
1998
1998
if (tmp == NULL) { \
1999
- htmlErrMemory(ctxt, "growing buffer\n" ); \
1999
+ htmlErrMemory(ctxt); \
2000
2000
xmlFree(buffer); \
2001
2001
return(NULL); \
2002
2002
} \
@@ -2273,7 +2273,7 @@ htmlNewInputStream(htmlParserCtxtPtr ctxt) {
2273
2273
2274
2274
input = (xmlParserInputPtr ) xmlMalloc (sizeof (htmlParserInput ));
2275
2275
if (input == NULL ) {
2276
- htmlErrMemory (ctxt , "couldn't allocate a new input stream\n" );
2276
+ htmlErrMemory (ctxt );
2277
2277
return (NULL );
2278
2278
}
2279
2279
memset (input , 0 , sizeof (htmlParserInput ));
@@ -2518,7 +2518,7 @@ htmlParseHTMLName(htmlParserCtxtPtr ctxt) {
2518
2518
2519
2519
ret = xmlDictLookup (ctxt -> dict , loc , i );
2520
2520
if (ret == NULL )
2521
- htmlErrMemory (ctxt , NULL );
2521
+ htmlErrMemory (ctxt );
2522
2522
2523
2523
return (ret );
2524
2524
}
@@ -2554,7 +2554,7 @@ htmlParseHTMLName_nonInvasive(htmlParserCtxtPtr ctxt) {
2554
2554
2555
2555
ret = xmlDictLookup (ctxt -> dict , loc , i );
2556
2556
if (ret == NULL )
2557
- htmlErrMemory (ctxt , NULL );
2557
+ htmlErrMemory (ctxt );
2558
2558
2559
2559
return (ret );
2560
2560
}
@@ -2599,7 +2599,7 @@ htmlParseName(htmlParserCtxtPtr ctxt) {
2599
2599
count = in - ctxt -> input -> cur ;
2600
2600
ret = xmlDictLookup (ctxt -> dict , ctxt -> input -> cur , count );
2601
2601
if (ret == NULL )
2602
- htmlErrMemory (ctxt , NULL );
2602
+ htmlErrMemory (ctxt );
2603
2603
ctxt -> input -> cur = in ;
2604
2604
ctxt -> input -> col += count ;
2605
2605
return (ret );
@@ -2659,7 +2659,7 @@ htmlParseNameComplex(xmlParserCtxtPtr ctxt) {
2659
2659
2660
2660
ret = xmlDictLookup (ctxt -> dict , ctxt -> input -> cur - len , len );
2661
2661
if (ret == NULL )
2662
- htmlErrMemory (ctxt , NULL );
2662
+ htmlErrMemory (ctxt );
2663
2663
2664
2664
return (ret );
2665
2665
}
@@ -2694,7 +2694,7 @@ htmlParseHTMLAttribute(htmlParserCtxtPtr ctxt, const xmlChar stop) {
2694
2694
buffer_size = HTML_PARSER_BUFFER_SIZE ;
2695
2695
buffer = (xmlChar * ) xmlMallocAtomic (buffer_size );
2696
2696
if (buffer == NULL ) {
2697
- htmlErrMemory (ctxt , "buffer allocation failed\n" );
2697
+ htmlErrMemory (ctxt );
2698
2698
return (NULL );
2699
2699
}
2700
2700
out = buffer ;
@@ -2959,7 +2959,7 @@ htmlParseSystemLiteral(htmlParserCtxtPtr ctxt) {
2959
2959
if (err == 0 ) {
2960
2960
ret = xmlStrndup ((BASE_PTR + startPosition ), len );
2961
2961
if (ret == NULL ) {
2962
- htmlErrMemory (ctxt , NULL );
2962
+ htmlErrMemory (ctxt );
2963
2963
return (NULL );
2964
2964
}
2965
2965
}
@@ -3020,7 +3020,7 @@ htmlParsePubidLiteral(htmlParserCtxtPtr ctxt) {
3020
3020
if (err == 0 ) {
3021
3021
ret = xmlStrndup ((BASE_PTR + startPosition ), len );
3022
3022
if (ret == NULL ) {
3023
- htmlErrMemory (ctxt , NULL );
3023
+ htmlErrMemory (ctxt );
3024
3024
return (NULL );
3025
3025
}
3026
3026
}
@@ -3330,7 +3330,7 @@ htmlParsePI(htmlParserCtxtPtr ctxt) {
3330
3330
}
3331
3331
buf = (xmlChar * ) xmlMallocAtomic (size );
3332
3332
if (buf == NULL ) {
3333
- htmlErrMemory (ctxt , NULL );
3333
+ htmlErrMemory (ctxt );
3334
3334
return ;
3335
3335
}
3336
3336
cur = CUR ;
@@ -3347,7 +3347,7 @@ htmlParsePI(htmlParserCtxtPtr ctxt) {
3347
3347
size *= 2 ;
3348
3348
tmp = (xmlChar * ) xmlRealloc (buf , size );
3349
3349
if (tmp == NULL ) {
3350
- htmlErrMemory (ctxt , NULL );
3350
+ htmlErrMemory (ctxt );
3351
3351
xmlFree (buf );
3352
3352
return ;
3353
3353
}
@@ -3428,7 +3428,7 @@ htmlParseComment(htmlParserCtxtPtr ctxt) {
3428
3428
SKIP (4 );
3429
3429
buf = (xmlChar * ) xmlMallocAtomic (size );
3430
3430
if (buf == NULL ) {
3431
- htmlErrMemory (ctxt , "buffer allocation failed\n" );
3431
+ htmlErrMemory (ctxt );
3432
3432
return ;
3433
3433
}
3434
3434
len = 0 ;
@@ -3472,7 +3472,7 @@ htmlParseComment(htmlParserCtxtPtr ctxt) {
3472
3472
tmp = (xmlChar * ) xmlRealloc (buf , size );
3473
3473
if (tmp == NULL ) {
3474
3474
xmlFree (buf );
3475
- htmlErrMemory (ctxt , "growing buffer failed\n" );
3475
+ htmlErrMemory (ctxt );
3476
3476
return ;
3477
3477
}
3478
3478
buf = tmp ;
@@ -3746,7 +3746,7 @@ htmlCheckEncoding(htmlParserCtxtPtr ctxt, const xmlChar *attvalue) {
3746
3746
encoding ++ ;
3747
3747
copy = xmlStrdup (encoding );
3748
3748
if (copy == NULL )
3749
- htmlErrMemory (ctxt , NULL );
3749
+ htmlErrMemory (ctxt );
3750
3750
xmlSetDeclaredEncoding (ctxt , copy );
3751
3751
}
3752
3752
}
@@ -3781,7 +3781,7 @@ htmlCheckMeta(htmlParserCtxtPtr ctxt, const xmlChar **atts) {
3781
3781
3782
3782
copy = xmlStrdup (value );
3783
3783
if (copy == NULL )
3784
- htmlErrMemory (ctxt , NULL );
3784
+ htmlErrMemory (ctxt );
3785
3785
xmlSetDeclaredEncoding (ctxt , copy );
3786
3786
} else if (!xmlStrcasecmp (att , BAD_CAST "content" )) {
3787
3787
content = value ;
@@ -3926,7 +3926,7 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
3926
3926
atts = (const xmlChar * * )
3927
3927
xmlMalloc (maxatts * sizeof (xmlChar * ));
3928
3928
if (atts == NULL ) {
3929
- htmlErrMemory (ctxt , NULL );
3929
+ htmlErrMemory (ctxt );
3930
3930
if (attvalue != NULL )
3931
3931
xmlFree (attvalue );
3932
3932
goto failed ;
@@ -3940,7 +3940,7 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
3940
3940
n = (const xmlChar * * ) xmlRealloc ((void * ) atts ,
3941
3941
maxatts * sizeof (const xmlChar * ));
3942
3942
if (n == NULL ) {
3943
- htmlErrMemory (ctxt , NULL );
3943
+ htmlErrMemory (ctxt );
3944
3944
if (attvalue != NULL )
3945
3945
xmlFree (attvalue );
3946
3946
goto failed ;
@@ -4591,7 +4591,7 @@ htmlParseContentInternal(htmlParserCtxtPtr ctxt) {
4591
4591
} else {
4592
4592
currentNode = xmlStrdup (ctxt -> name );
4593
4593
if (currentNode == NULL ) {
4594
- htmlErrMemory (ctxt , NULL );
4594
+ htmlErrMemory (ctxt );
4595
4595
return ;
4596
4596
}
4597
4597
}
@@ -4613,7 +4613,7 @@ htmlParseContentInternal(htmlParserCtxtPtr ctxt) {
4613
4613
} else {
4614
4614
currentNode = xmlStrdup (ctxt -> name );
4615
4615
if (currentNode == NULL ) {
4616
- htmlErrMemory (ctxt , NULL );
4616
+ htmlErrMemory (ctxt );
4617
4617
break ;
4618
4618
}
4619
4619
}
@@ -4642,7 +4642,7 @@ htmlParseContentInternal(htmlParserCtxtPtr ctxt) {
4642
4642
} else {
4643
4643
currentNode = xmlStrdup (ctxt -> name );
4644
4644
if (currentNode == NULL ) {
4645
- htmlErrMemory (ctxt , NULL );
4645
+ htmlErrMemory (ctxt );
4646
4646
break ;
4647
4647
}
4648
4648
}
@@ -4673,7 +4673,7 @@ htmlParseContentInternal(htmlParserCtxtPtr ctxt) {
4673
4673
} else {
4674
4674
currentNode = xmlStrdup (ctxt -> name );
4675
4675
if (currentNode == NULL ) {
4676
- htmlErrMemory (ctxt , NULL );
4676
+ htmlErrMemory (ctxt );
4677
4677
break ;
4678
4678
}
4679
4679
}
@@ -4732,7 +4732,7 @@ htmlParseContentInternal(htmlParserCtxtPtr ctxt) {
4732
4732
} else {
4733
4733
currentNode = xmlStrdup (ctxt -> name );
4734
4734
if (currentNode == NULL ) {
4735
- htmlErrMemory (ctxt , NULL );
4735
+ htmlErrMemory (ctxt );
4736
4736
break ;
4737
4737
}
4738
4738
}
@@ -4901,7 +4901,7 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) {
4901
4901
BAD_CAST "-//W3C//DTD HTML 4.0 Transitional//EN" ,
4902
4902
BAD_CAST "http://www.w3.org/TR/REC-html40/loose.dtd" );
4903
4903
if (ctxt -> myDoc -> intSubset == NULL )
4904
- htmlErrMemory (ctxt , NULL );
4904
+ htmlErrMemory (ctxt );
4905
4905
}
4906
4906
}
4907
4907
if (! ctxt -> wellFormed ) return (-1 );
@@ -5786,7 +5786,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
5786
5786
BAD_CAST "-//W3C//DTD HTML 4.0 Transitional//EN" ,
5787
5787
BAD_CAST "http://www.w3.org/TR/REC-html40/loose.dtd" );
5788
5788
if (ctxt -> myDoc -> intSubset == NULL )
5789
- htmlErrMemory (ctxt , NULL );
5789
+ htmlErrMemory (ctxt );
5790
5790
}
5791
5791
}
5792
5792
return (ret );
@@ -6722,7 +6722,7 @@ htmlCtxtReadMemory(htmlParserCtxtPtr ctxt, const char *buffer, int size,
6722
6722
input = xmlParserInputBufferCreateStatic (buffer , size ,
6723
6723
XML_CHAR_ENCODING_NONE );
6724
6724
if (input == NULL ) {
6725
- htmlErrMemory (ctxt , NULL );
6725
+ htmlErrMemory (ctxt );
6726
6726
return (NULL );
6727
6727
}
6728
6728
0 commit comments