pidgin/ljfisher-ssl-client-auth

media: Fix a NULL pointer deref crash, and add diagnostic logging.

I'm not entirely sure that just short-circuiting error handling in this
case is correct (in fact I suspect it's not), but it's certainly better
than a crash, and now there's detail on the actual error.

Closes #14033
--- a/libpurple/media/backend-fs2.c Wed May 11 09:29:47 2011 +0000
+++ b/libpurple/media/backend-fs2.c Thu May 12 01:21:50 2011 +0000
@@ -1081,6 +1081,22 @@
GstElement *lastElement = NULL;
GList *sessions;
+ GError *error = NULL;
+ gchar *debug_msg = NULL;
+
+ gst_message_parse_error(msg, &error, &debug_msg);
+ purple_debug_error("backend-fs2", "gst error %s\ndebugging: %s\n",
+ error->message, debug_msg);
+
+ g_error_free(error);
+ g_free(debug_msg);
+
+ /* Not entirely sure this is correct, but prevents a
+ * NULL deref crash.
+ */
+ if (!element)
+ return;
+
while (!GST_IS_PIPELINE(element)) {
if (element == priv->confbin)
break;