[Bf-blender-cvs] [65253960578] workspaces: Cleanup: use calloc for DNA data

Campbell Barton noreply at git.blender.org
Sun Apr 9 08:14:48 CEST 2017


Commit: 65253960578cef9d9dc3656563600c211b4efd2e
Author: Campbell Barton
Date:   Sun Apr 9 15:03:36 2017 +1000
Branches: workspaces
https://developer.blender.org/rB65253960578cef9d9dc3656563600c211b4efd2e

Cleanup: use calloc for DNA data

ensures pad-members are set, avoids junk data in the file & quiets
memory checking tools.

===================================================================

M	source/blender/blenkernel/intern/workspace.c

===================================================================

diff --git a/source/blender/blenkernel/intern/workspace.c b/source/blender/blenkernel/intern/workspace.c
index c0af19c189b..b0829f0213d 100644
--- a/source/blender/blenkernel/intern/workspace.c
+++ b/source/blender/blenkernel/intern/workspace.c
@@ -77,7 +77,7 @@ static WorkSpaceLayout *workspace_layout_find_exec(
 static void workspace_relation_add(
         ListBase *relation_list, void *parent, void *data)
 {
-	WorkSpaceDataRelation *relation = MEM_mallocN(sizeof(*relation), __func__);
+	WorkSpaceDataRelation *relation = MEM_callocN(sizeof(*relation), __func__);
 	relation->parent = parent;
 	relation->value = data;
 	/* add to head, if we switch back to it soon we find it faster. */
@@ -215,7 +215,7 @@ WorkSpaceLayout *BKE_workspace_layout_add(
         bScreen *screen,
         const char *name)
 {
-	WorkSpaceLayout *layout = MEM_mallocN(sizeof(*layout), __func__);
+	WorkSpaceLayout *layout = MEM_callocN(sizeof(*layout), __func__);
 
 	BLI_assert(!workspaces_is_screen_used(G.main, screen));
 	layout->screen = screen;




More information about the Bf-blender-cvs mailing list