Added settings dialog, fixed a simple leak in gst_pitch_setup_algorithm()
[tunertool] / src / gstpitch.c
index 0250a5a..2cce8d3 100644 (file)
@@ -171,7 +171,8 @@ static void
 gst_pitch_setup_algorithm (GstPitch * filter)
 {
   if (filter->algorithm == GST_PITCH_ALGORITHM_HPS) {
-    filter->module = (gint *) g_malloc (RATE * sizeof (gint));
+    if (NULL == filter->module)
+      filter->module = (gint *) g_malloc (RATE * sizeof (gint));
   }
   else {
     if (filter->module)