mirror of
https://github.com/libexpat/libexpat.git
synced 2025-04-04 21:04:57 +00:00
tests: Address Cppcheck 2.17.1 warning about malloc returning NULL
This commit is contained in:
parent
688483ee3b
commit
ba7853edef
1 changed files with 2 additions and 0 deletions
|
@ -294,6 +294,7 @@ START_TEST(test_misc_stop_during_end_handler_issue_240_1) {
|
|||
parser = XML_ParserCreate(NULL);
|
||||
XML_SetElementHandler(parser, start_element_issue_240, end_element_issue_240);
|
||||
mydata = (DataIssue240 *)malloc(sizeof(DataIssue240));
|
||||
assert_true(mydata != NULL);
|
||||
mydata->parser = parser;
|
||||
mydata->deep = 0;
|
||||
XML_SetUserData(parser, mydata);
|
||||
|
@ -315,6 +316,7 @@ START_TEST(test_misc_stop_during_end_handler_issue_240_2) {
|
|||
parser = XML_ParserCreate(NULL);
|
||||
XML_SetElementHandler(parser, start_element_issue_240, end_element_issue_240);
|
||||
mydata = (DataIssue240 *)malloc(sizeof(DataIssue240));
|
||||
assert_true(mydata != NULL);
|
||||
mydata->parser = parser;
|
||||
mydata->deep = 0;
|
||||
XML_SetUserData(parser, mydata);
|
||||
|
|
Loading…
Add table
Reference in a new issue