Added check for malloc returning a valid pointer
This commit is contained in:
parent
6d65768dab
commit
24f8a01f17
@ -549,6 +549,8 @@ kfdata_read(Lib3dsFile *file, Lib3dsIo *io) {
|
||||
|
||||
{
|
||||
Lib3dsNode **nodes = (Lib3dsNode **)malloc(num_nodes * sizeof(Lib3dsNode*));
|
||||
if (nodes)
|
||||
{
|
||||
unsigned i;
|
||||
Lib3dsNode *p, *q, *parent;
|
||||
|
||||
@ -579,6 +581,7 @@ kfdata_read(Lib3dsFile *file, Lib3dsIo *io) {
|
||||
}
|
||||
free(nodes);
|
||||
}
|
||||
}
|
||||
|
||||
lib3ds_chunk_read_end(&c, io);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user