Make memory checker happy about FileGlobal
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 22 Jan 2014 10:23:55 +0000 (16:23 +0600)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 22 Jan 2014 10:32:52 +0000 (16:32 +0600)
FileGlobal structure in write_global() didn't initialize
the while build_hash property and only placed there null
terminated meaningful content, leaving trailing uninitialized.

This made valgrind complain about using uninitialized memory
later in undo stack.

source/blender/blenloader/intern/writefile.c

index b60459e2477106ce56129a8a43c5fea07e8de02d..238ba0cce2ff573c4e28f595844f6a88075dda23 100644 (file)
@@ -3274,6 +3274,7 @@ static void write_global(WriteData *wd, int fileflags, Main *mainvar)
        /* prevent mem checkers from complaining */
        fg.pads= 0;
        memset(fg.filename, 0, sizeof(fg.filename));
+       memset(fg.build_hash, 0, sizeof(fg.build_hash));
 
        current_screen_compat(mainvar, &screen);