Fix buffer overflow vulernability in thumbnail file reading.
[blender.git] / source / blender / makesdna / intern / dna_genfile.c
index 181d01e04fc8580eeb1d6aa94fdd815983ed7a22..dec93f97c6c54f73768d2cf4bdb1408654bdd10a 100644 (file)
@@ -173,7 +173,9 @@ void DNA_sdna_free(SDNA *sdna)
        MEM_freeN(sdna->structs);
 
 #ifdef WITH_DNA_GHASH
-       BLI_ghash_free(sdna->structs_map, NULL, NULL);
+       if (sdna->structs_map) {
+               BLI_ghash_free(sdna->structs_map, NULL, NULL);
+       }
 #endif
 
        MEM_freeN(sdna);