utils: Fix leak in failed case of regression overflow checking
authorHeekyoung Seo <heekyoung.seo@lge.com>
Tue, 20 Jun 2017 06:57:47 +0000 (15:57 +0900)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 20 Jun 2017 07:58:22 +0000 (10:58 +0300)
https://bugzilla.gnome.org/show_bug.cgi?id=783978

gst/gstutils.c

index ec3a335..79193cc 100644 (file)
@@ -4252,6 +4252,8 @@ gst_calculate_linear_regression (const GstClockTime * xy,
           G_GUINT64_FORMAT " newx[j] %" G_GUINT64_FORMAT " ybar %"
           G_GUINT64_FORMAT " newy[j] %" G_GUINT64_FORMAT, xbar, newx[j], ybar,
           newy[j]);
+      if (temp == NULL && n > 64)
+        g_free (newx);
       return FALSE;
     }