Fix game-property use-after-free error
authorCampbell Barton <ideasman42@gmail.com>
Wed, 7 Oct 2015 00:04:23 +0000 (11:04 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 7 Oct 2015 00:05:27 +0000 (11:05 +1100)
D1538 by @hal01

source/blender/blenkernel/intern/property.c

index 100df5fd121ce626d04952df34771bcae8fab485..dc4063b42edfaa2a898634d25f139d458cf0345c 100644 (file)
@@ -142,8 +142,8 @@ void BKE_bproperty_object_set(Object *ob, bProperty *propc)
        bProperty *prop;
        prop = BKE_bproperty_object_get(ob, propc->name);
        if (prop) {
-               BKE_bproperty_free(prop);
                BLI_remlink(&ob->prop, prop);
+               BKE_bproperty_free(prop);
        }
        BLI_addtail(&ob->prop, BKE_bproperty_copy(propc));
 }