From 1949360f9bdf67b199ecadc11a8e619c0c3ce358 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Fri, 11 Sep 2009 21:20:57 +0300 Subject: [PATCH] binaryregistry: don't crash in cleaning up on error. Don't dereference NULL pointers. --- gst/gstregistrybinary.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gst/gstregistrybinary.c b/gst/gstregistrybinary.c index 09c6ae3..661685e 100644 --- a/gst/gstregistrybinary.c +++ b/gst/gstregistrybinary.c @@ -794,9 +794,11 @@ fail_free_list: for (walk = to_write; walk; walk = g_list_next (walk)) { GstBinaryChunk *cur = walk->data; - if (!(cur->flags & GST_BINARY_REGISTRY_FLAG_CONST)) - g_free (cur->data); - g_free (cur); + if (cur) { + if (!(cur->flags & GST_BINARY_REGISTRY_FLAG_CONST)) + g_free (cur->data); + g_free (cur); + } } g_list_free (to_write); -- 2.7.4