From 167e7529e7deece2728b9b067737f7cd31c86521 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 30 Jul 2016 18:18:07 -0400 Subject: Use calloc to allocate instances --- plugins/eg-fifths.lv2/fifths.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'plugins/eg-fifths.lv2') diff --git a/plugins/eg-fifths.lv2/fifths.c b/plugins/eg-fifths.lv2/fifths.c index 9345399..8282dd5 100644 --- a/plugins/eg-fifths.lv2/fifths.c +++ b/plugins/eg-fifths.lv2/fifths.c @@ -1,6 +1,6 @@ /* LV2 Fifths Example Plugin - Copyright 2014 David Robillard + Copyright 2014-2016 David Robillard Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -74,11 +74,10 @@ instantiate(const LV2_Descriptor* descriptor, const LV2_Feature* const* features) { // Allocate and initialise instance structure. - Fifths* self = (Fifths*)malloc(sizeof(Fifths)); + Fifths* self = (Fifths*)calloc(1, sizeof(Fifths)); if (!self) { return NULL; } - memset(self, 0, sizeof(Fifths)); // Get host features for (int i = 0; features[i]; ++i) { -- cgit v1.2.1