summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@hotmail.com>2014-07-06 01:55:50 +0200
committerEdward Hervey <bilboed@bilboed.com>2014-07-09 12:04:17 +0200
commitfba6ebaae2d9adb5aa501fc81b4a7005042f71c6 (patch)
treea5fb1fe2dde532e90bbe7eb3684bafbe65a01ae7
parent66c38b50f3ddd911eb5abd05e8095e438cadec78 (diff)
downloadgstreamer-plugins-bad-fba6ebaae2d9adb5aa501fc81b4a7005042f71c6.tar.gz
mpegts: No need to check for NULL before calling g_free()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=732789
-rw-r--r--gst-libs/gst/mpegts/gst-atsc-section.c3
-rw-r--r--gst-libs/gst/mpegts/gst-dvb-descriptor.c14
-rw-r--r--gst-libs/gst/mpegts/gstmpegtsdescriptor.c6
-rw-r--r--gst-libs/gst/mpegts/gstmpegtssection.c3
4 files changed, 8 insertions, 18 deletions
diff --git a/gst-libs/gst/mpegts/gst-atsc-section.c b/gst-libs/gst/mpegts/gst-atsc-section.c
index 021c8e607..459a323e0 100644
--- a/gst-libs/gst/mpegts/gst-atsc-section.c
+++ b/gst-libs/gst/mpegts/gst-atsc-section.c
@@ -411,8 +411,7 @@ _gst_mpegts_atsc_string_segment_copy (GstMpegtsAtscStringSegment * seg)
static void
_gst_mpegts_atsc_string_segment_free (GstMpegtsAtscStringSegment * seg)
{
- if (seg->cached_string)
- g_free (seg->cached_string);
+ g_free (seg->cached_string);
g_slice_free (GstMpegtsAtscStringSegment, seg);
}
diff --git a/gst-libs/gst/mpegts/gst-dvb-descriptor.c b/gst-libs/gst/mpegts/gst-dvb-descriptor.c
index c1f2c3096..29b24424d 100644
--- a/gst-libs/gst/mpegts/gst-dvb-descriptor.c
+++ b/gst-libs/gst/mpegts/gst-dvb-descriptor.c
@@ -522,10 +522,8 @@ gst_mpegts_descriptor_from_dvb_service (GstMpegtsDVBServiceType service_type,
memcpy (data, conv_service_name, service_size);
beach:
- if (conv_service_name)
- g_free (conv_service_name);
- if (conv_provider_name)
- g_free (conv_provider_name);
+ g_free (conv_service_name);
+ g_free (conv_provider_name);
return descriptor;
}
@@ -1138,12 +1136,8 @@ _gst_mpegts_dvb_component_descriptor_copy (GstMpegtsComponentDescriptor *
void
gst_mpegts_dvb_component_descriptor_free (GstMpegtsComponentDescriptor * source)
{
- if (source->language_code)
- g_free (source->language_code);
-
- if (source->text)
- g_free (source->text);
-
+ g_free (source->language_code);
+ g_free (source->text);
g_slice_free (GstMpegtsComponentDescriptor, source);
}
diff --git a/gst-libs/gst/mpegts/gstmpegtsdescriptor.c b/gst-libs/gst/mpegts/gstmpegtsdescriptor.c
index 44a4ef968..246aee45f 100644
--- a/gst-libs/gst/mpegts/gstmpegtsdescriptor.c
+++ b/gst-libs/gst/mpegts/gstmpegtsdescriptor.c
@@ -338,8 +338,7 @@ out:
if (error) {
GST_WARNING ("Could not convert from utf-8: %s", error->message);
g_error_free (error);
- if (out_text)
- g_free (out_text);
+ g_free (out_text);
return NULL;
}
@@ -571,8 +570,7 @@ get_encoding_and_convert (const gchar * text, guint length)
giconv, is_multibyte, &error);
if (error != NULL) {
GST_WARNING ("Could not convert string: %s", error->message);
- if (converted_str)
- g_free (converted_str);
+ g_free (converted_str);
g_error_free (error);
error = NULL;
diff --git a/gst-libs/gst/mpegts/gstmpegtssection.c b/gst-libs/gst/mpegts/gstmpegtssection.c
index 1006576dd..527ff38af 100644
--- a/gst-libs/gst/mpegts/gstmpegtssection.c
+++ b/gst-libs/gst/mpegts/gstmpegtssection.c
@@ -184,8 +184,7 @@ _gst_mpegts_section_free (GstMpegtsSection * section)
if (section->cached_parsed && section->destroy_parsed)
section->destroy_parsed (section->cached_parsed);
- if (section->data)
- g_free (section->data);
+ g_free (section->data);
g_slice_free (GstMpegtsSection, section);
}