Fixed Coverity Scan reported issue

This commit is contained in:
Robert Osfield
2017-10-31 17:02:31 +00:00
parent 95eb5e2ad6
commit 061e52b89f

View File

@@ -165,7 +165,8 @@ load_md2 (const char *filename, const osgDB::ReaderWriter::Options* options)
return NULL;
}
mapbase = malloc (st.st_size);
mapbase = malloc (st.st_size+1);
memset(mapbase, 0, st.st_size+1);
if (!mapbase)
{
close (file_fd);