diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index 5073cfe08b8..befcc0a71cb 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -82,6 +82,12 @@ void delete_fcurve_key(FCurve *fcu, int index, short do_recalc) /* Delete this keyframe */ memmove(&fcu->bezt[index], &fcu->bezt[index+1], sizeof(BezTriple)*(fcu->totvert-index-1)); fcu->totvert--; + + if (fcu->totvert == 0) { + if (fcu->bezt) + MEM_freeN(fcu->bezt); + fcu->bezt= NULL; + } /* recalc handles - only if it won't cause problems */ if (do_recalc)