Added check for malloc returning a valid pointer

This commit is contained in:
Robert Osfield 2017-11-03 09:55:42 +00:00
parent 6d65768dab
commit 24f8a01f17

View File

@ -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);
}