summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>2015-11-17 15:23:17 -0800
committerReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>2015-11-18 16:05:42 -0800
commit86ec81242987d876ef0760b6d9201c79de9d1bf4 (patch)
tree7218eb94926339718084cf101ab76907d8912793
parent87b5ad0dfc2cca4c35337f85bc0f5b89fe462d6a (diff)
Remove unnecessary NULL checks before g_free()
g_free() is NULL-safe
-rw-r--r--ext/audiofile/gstafsink.c3
-rw-r--r--ext/audiofile/gstafsrc.c3
-rw-r--r--ext/dash/gstmpdparser.c3
-rw-r--r--ext/gl/gstglbumper.c3
-rw-r--r--ext/gl/gstgldifferencematte.c3
-rw-r--r--ext/gl/gstglfiltershader.c12
-rw-r--r--ext/gl/gstgloverlay.c3
-rw-r--r--ext/hls/gsthlsdemux.c6
-rw-r--r--ext/kate/gstkateenc.c9
-rw-r--r--ext/kate/gstkatespu.c3
-rw-r--r--ext/kate/gstkateutil.c6
-rw-r--r--ext/libmms/gstmms.c3
-rw-r--r--ext/neon/gstneonhttpsrc.c3
-rw-r--r--ext/opus/gstopusenc.c3
-rw-r--r--ext/sndfile/gstsfsink.c3
-rw-r--r--ext/sndfile/gstsfsrc.c3
-rw-r--r--ext/spc/tag.c21
-rw-r--r--ext/timidity/gsttimidity.c3
-rw-r--r--ext/wayland/gstwaylandsink.c3
-rw-r--r--gst-libs/gst/gl/gstglfeature.c3
-rw-r--r--gst-libs/gst/gl/gstglslstage.c3
-rw-r--r--gst-libs/gst/gl/gstglutils.c3
-rw-r--r--gst-libs/gst/gl/x11/gstgldisplay_x11.c3
-rw-r--r--gst/audiovisualizers/gstwavescope.c3
-rw-r--r--gst/dvbsuboverlay/dvb-sub.c6
-rw-r--r--gst/librfb/rfbdecoder.c6
-rw-r--r--gst/mpegtsdemux/mpegtspacketizer.c3
-rw-r--r--gst/mpegtsdemux/tsdemux.c6
-rw-r--r--gst/mpegtsmux/tsmux/tsmux.c3
-rw-r--r--sys/acmenc/acmenc.c6
-rw-r--r--sys/acmmp3dec/acmmp3dec.c6
-rw-r--r--sys/applemedia/avfassetsrc.m8
-rw-r--r--sys/bluez/gsta2dpsink.c6
-rw-r--r--sys/bluez/gstavdtpsink.c6
-rw-r--r--sys/bluez/gstavdtputil.c6
-rw-r--r--sys/dshowdecwrapper/gstdshowaudiodec.cpp3
-rw-r--r--sys/dshowdecwrapper/gstdshowvideodec.cpp3
-rw-r--r--sys/dshowsrcwrapper/gstdshow.cpp6
-rw-r--r--sys/dshowsrcwrapper/gstdshowvideosrc.cpp4
-rw-r--r--sys/dshowvideosink/dshowvideosink.cpp7
-rw-r--r--sys/dvb/camswclient.c3
-rw-r--r--sys/dvb/dvbbasebin.c3
-rw-r--r--sys/dvb/parsechannels.c3
-rw-r--r--sys/pvr2d/gstpvrvideosink.c7
-rw-r--r--sys/uvch264/gstuvch264_mjpgdemux.c3
-rw-r--r--sys/vdpau/gstvdpvideomemory.c3
-rw-r--r--tests/examples/gtk/glliveshader.c3
-rw-r--r--tests/icles/metadata_editor.c3
48 files changed, 73 insertions, 151 deletions
diff --git a/ext/audiofile/gstafsink.c b/ext/audiofile/gstafsink.c
index 22c66cb3c..6fb39842e 100644
--- a/ext/audiofile/gstafsink.c
+++ b/ext/audiofile/gstafsink.c
@@ -217,8 +217,7 @@ gst_afsink_set_property (GObject * object, guint prop_id, const GValue * value,
/* the element must be stopped or paused in order to do this */
g_return_if_fail ((GST_STATE (sink) < GST_STATE_PLAYING)
|| (GST_STATE (sink) == GST_STATE_PAUSED));
- if (sink->filename)
- g_free (sink->filename);
+ g_free (sink->filename);
sink->filename = g_strdup (g_value_get_string (value));
if ((GST_STATE (sink) == GST_STATE_PAUSED)
&& (sink->filename != NULL)) {
diff --git a/ext/audiofile/gstafsrc.c b/ext/audiofile/gstafsrc.c
index 45f86be83..ce4db3963 100644
--- a/ext/audiofile/gstafsrc.c
+++ b/ext/audiofile/gstafsrc.c
@@ -250,8 +250,7 @@ gst_afsrc_set_property (GObject * object, guint prop_id, const GValue * value,
switch (prop_id) {
case ARG_LOCATION:
- if (src->filename)
- g_free (src->filename);
+ g_free (src->filename);
src->filename = g_strdup (g_value_get_string (value));
break;
default:
diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c
index 7b0e43862..7642cebfb 100644
--- a/ext/dash/gstmpdparser.c
+++ b/ext/dash/gstmpdparser.c
@@ -3366,8 +3366,7 @@ combine_urls (GstUri * base, GList * list, gchar ** query, guint idx)
gst_uri_unref (base);
if (ret && query) {
- if (*query)
- g_free (*query);
+ g_free (*query);
*query = gst_uri_get_query_string (ret);
if (*query) {
ret = gst_uri_make_writable (ret);
diff --git a/ext/gl/gstglbumper.c b/ext/gl/gstglbumper.c
index 188663b46..5820fac36 100644
--- a/ext/gl/gstglbumper.c
+++ b/ext/gl/gstglbumper.c
@@ -329,8 +329,7 @@ gst_gl_bumper_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_LOCATION:
- if (bumper->location != NULL)
- g_free (bumper->location);
+ g_free (bumper->location);
bumper->location = g_value_dup_string (value);
break;
default:
diff --git a/ext/gl/gstgldifferencematte.c b/ext/gl/gstgldifferencematte.c
index a746b3dfd..8ffcf9b93 100644
--- a/ext/gl/gstgldifferencematte.c
+++ b/ext/gl/gstgldifferencematte.c
@@ -236,8 +236,7 @@ gst_gl_differencematte_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_LOCATION:
- if (differencematte->location != NULL)
- g_free (differencematte->location);
+ g_free (differencematte->location);
differencematte->bg_has_changed = TRUE;
differencematte->location = g_value_dup_string (value);
break;
diff --git a/ext/gl/gstglfiltershader.c b/ext/gl/gstglfiltershader.c
index 8d3bb7fc6..510dcc44a 100644
--- a/ext/gl/gstglfiltershader.c
+++ b/ext/gl/gstglfiltershader.c
@@ -164,12 +164,10 @@ gst_gl_filtershader_finalize (GObject * object)
{
GstGLFilterShader *filtershader = GST_GL_FILTERSHADER (object);
- if (filtershader->vertex)
- g_free (filtershader->vertex);
+ g_free (filtershader->vertex);
filtershader->vertex = NULL;
- if (filtershader->fragment)
- g_free (filtershader->fragment);
+ g_free (filtershader->fragment);
filtershader->fragment = NULL;
if (filtershader->uniforms)
@@ -195,16 +193,14 @@ gst_gl_filtershader_set_property (GObject * object, guint prop_id,
break;
case PROP_VERTEX:
GST_OBJECT_LOCK (filtershader);
- if (filtershader->vertex)
- g_free (filtershader->vertex);
+ g_free (filtershader->vertex);
filtershader->vertex = g_value_dup_string (value);
filtershader->new_source = TRUE;
GST_OBJECT_UNLOCK (filtershader);
break;
case PROP_FRAGMENT:
GST_OBJECT_LOCK (filtershader);
- if (filtershader->fragment)
- g_free (filtershader->fragment);
+ g_free (filtershader->fragment);
filtershader->fragment = g_value_dup_string (value);
filtershader->new_source = TRUE;
GST_OBJECT_UNLOCK (filtershader);
diff --git a/ext/gl/gstgloverlay.c b/ext/gl/gstgloverlay.c
index d4c1ee1a1..a152fc22c 100644
--- a/ext/gl/gstgloverlay.c
+++ b/ext/gl/gstgloverlay.c
@@ -277,8 +277,7 @@ gst_gl_overlay_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_LOCATION:
- if (overlay->location != NULL)
- g_free (overlay->location);
+ g_free (overlay->location);
overlay->location_has_changed = TRUE;
overlay->location = g_value_dup_string (value);
break;
diff --git a/ext/hls/gsthlsdemux.c b/ext/hls/gsthlsdemux.c
index e3c0096eb..13947c04b 100644
--- a/ext/hls/gsthlsdemux.c
+++ b/ext/hls/gsthlsdemux.c
@@ -674,11 +674,9 @@ gst_hls_demux_update_fragment_info (GstAdaptiveDemuxStream * stream)
stream->fragment.timestamp = GST_CLOCK_TIME_NONE;
}
- if (hlsdemux->current_key)
- g_free (hlsdemux->current_key);
+ g_free (hlsdemux->current_key);
hlsdemux->current_key = key;
- if (hlsdemux->current_iv)
- g_free (hlsdemux->current_iv);
+ g_free (hlsdemux->current_iv);
hlsdemux->current_iv = iv;
g_free (stream->fragment.uri);
stream->fragment.uri = next_fragment_uri;
diff --git a/ext/kate/gstkateenc.c b/ext/kate/gstkateenc.c
index 595868f3e..a48ea1e2c 100644
--- a/ext/kate/gstkateenc.c
+++ b/ext/kate/gstkateenc.c
@@ -791,12 +791,9 @@ gst_kate_enc_chain_spu (GstKateEnc * ke, GstBuffer * buf)
kbitmap = (kate_bitmap *) g_malloc (sizeof (kate_bitmap));
kpalette = (kate_palette *) g_malloc (sizeof (kate_palette));
if (!kregion || !kpalette || !kbitmap) {
- if (kregion)
- g_free (kregion);
- if (kbitmap)
- g_free (kbitmap);
- if (kpalette)
- g_free (kpalette);
+ g_free (kregion);
+ g_free (kbitmap);
+ g_free (kpalette);
GST_ELEMENT_ERROR (ke, STREAM, ENCODE, (NULL), ("Out of memory"));
return GST_FLOW_ERROR;
}
diff --git a/ext/kate/gstkatespu.c b/ext/kate/gstkatespu.c
index bdf0dd829..b7838c13e 100644
--- a/ext/kate/gstkatespu.c
+++ b/ext/kate/gstkatespu.c
@@ -911,7 +911,6 @@ gst_kate_spu_encode_spu (GstKateDec * kd, const kate_event * ev)
error:
kate_tracker_clear (&kin);
- if (bytes)
- g_free (bytes);
+ g_free (bytes);
return NULL;
}
diff --git a/ext/kate/gstkateutil.c b/ext/kate/gstkateutil.c
index 93777ab58..cf1a2af47 100644
--- a/ext/kate/gstkateutil.c
+++ b/ext/kate/gstkateutil.c
@@ -371,11 +371,9 @@ gst_kate_util_decoder_base_chain_kate_packet (GstKateDecoderBase * decoder,
}
/* update properties */
- if (decoder->language)
- g_free (decoder->language);
+ g_free (decoder->language);
decoder->language = g_strdup (decoder->k.ki->language);
- if (decoder->category)
- g_free (decoder->category);
+ g_free (decoder->category);
decoder->category = g_strdup (decoder->k.ki->category);
decoder->original_canvas_width = decoder->k.ki->original_canvas_width;
decoder->original_canvas_height = decoder->k.ki->original_canvas_height;
diff --git a/ext/libmms/gstmms.c b/ext/libmms/gstmms.c
index 25938c872..5e3ff386f 100644
--- a/ext/libmms/gstmms.c
+++ b/ext/libmms/gstmms.c
@@ -609,8 +609,7 @@ gst_mms_uri_set_uri (GstURIHandler * handler, const gchar * uri,
}
GST_OBJECT_LOCK (src);
- if (src->uri_name)
- g_free (src->uri_name);
+ g_free (src->uri_name);
src->uri_name = fixed_uri;
GST_OBJECT_UNLOCK (src);
diff --git a/ext/neon/gstneonhttpsrc.c b/ext/neon/gstneonhttpsrc.c
index e20b509c5..8a4ff0d37 100644
--- a/ext/neon/gstneonhttpsrc.c
+++ b/ext/neon/gstneonhttpsrc.c
@@ -321,8 +321,7 @@ gst_neonhttp_src_set_property (GObject * object, guint prop_id,
break;
}
case PROP_USER_AGENT:
- if (src->user_agent)
- g_free (src->user_agent);
+ g_free (src->user_agent);
src->user_agent = g_strdup (g_value_get_string (value));
break;
case PROP_COOKIES:
diff --git a/ext/opus/gstopusenc.c b/ext/opus/gstopusenc.c
index d4a685adc..9214837ca 100644
--- a/ext/opus/gstopusenc.c
+++ b/ext/opus/gstopusenc.c
@@ -1091,8 +1091,7 @@ done:
if (bdata)
gst_buffer_unmap (buf, &map);
- if (mdata)
- g_free (mdata);
+ g_free (mdata);
return ret;
}
diff --git a/ext/sndfile/gstsfsink.c b/ext/sndfile/gstsfsink.c
index c7f819499..5dc5e3af1 100644
--- a/ext/sndfile/gstsfsink.c
+++ b/ext/sndfile/gstsfsink.c
@@ -148,8 +148,7 @@ gst_sf_sink_set_location (GstSFSink * this, const gchar * location)
if (this->file)
goto was_open;
- if (this->location)
- g_free (this->location);
+ g_free (this->location);
this->location = location ? g_strdup (location) : NULL;
diff --git a/ext/sndfile/gstsfsrc.c b/ext/sndfile/gstsfsrc.c
index d41953d2f..1090e68b9 100644
--- a/ext/sndfile/gstsfsrc.c
+++ b/ext/sndfile/gstsfsrc.c
@@ -146,8 +146,7 @@ gst_sf_src_set_location (GstSFSrc * this, const gchar * location)
if (this->file)
goto was_open;
- if (this->location)
- g_free (this->location);
+ g_free (this->location);
this->location = location ? g_strdup (location) : NULL;
diff --git a/ext/spc/tag.c b/ext/spc/tag.c
index 61e59d50f..bc13ecb72 100644
--- a/ext/spc/tag.c
+++ b/ext/spc/tag.c
@@ -328,20 +328,13 @@ spc_tag_get_info (guchar * data, guint length, spc_tag_info * info)
void
spc_tag_free (spc_tag_info * info)
{
- if (info->title)
- g_free (info->title);
- if (info->game)
- g_free (info->game);
- if (info->artist)
- g_free (info->artist);
- if (info->album)
- g_free (info->album);
- if (info->publisher)
- g_free (info->publisher);
- if (info->comment)
- g_free (info->comment);
- if (info->dumper)
- g_free (info->dumper);
+ g_free (info->title);
+ g_free (info->game);
+ g_free (info->artist);
+ g_free (info->album);
+ g_free (info->publisher);
+ g_free (info->comment);
+ g_free (info->dumper);
if (info->dump_date)
g_date_free (info->dump_date);
}
diff --git a/ext/timidity/gsttimidity.c b/ext/timidity/gsttimidity.c
index 086779538..418a5fe4c 100644
--- a/ext/timidity/gsttimidity.c
+++ b/ext/timidity/gsttimidity.c
@@ -588,8 +588,7 @@ gst_timidity_loop (GstPad * sinkpad)
goto paused;
}
- if (timidity->mididata)
- g_free (timidity->mididata);
+ g_free (timidity->mididata);
timidity->mididata = g_malloc (timidity->mididata_size);
timidity->mididata_offset = 0;
diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c
index 10d477e8b..2d2860cd2 100644
--- a/ext/wayland/gstwaylandsink.c
+++ b/ext/wayland/gstwaylandsink.c
@@ -219,8 +219,7 @@ gst_wayland_sink_finalize (GObject * object)
if (sink->pool)
gst_object_unref (sink->pool);
- if (sink->display_name)
- g_free (sink->display_name);
+ g_free (sink->display_name);
g_mutex_clear (&sink->display_lock);
g_mutex_clear (&sink->render_lock);
diff --git a/gst-libs/gst/gl/gstglfeature.c b/gst-libs/gst/gl/gstglfeature.c
index 4a5d876b5..862fadc47 100644
--- a/gst-libs/gst/gl/gstglfeature.c
+++ b/gst-libs/gst/gl/gstglfeature.c
@@ -189,8 +189,7 @@ _gst_gl_feature_check (GstGLContext * context,
for (func_num = 0; data->functions[func_num].name; func_num++) {
void *func;
- if (full_function_name)
- g_free (full_function_name);
+ g_free (full_function_name);
full_function_name = g_strconcat ("gl", data->functions[func_num].name,
suffix, NULL);
diff --git a/gst-libs/gst/gl/gstglslstage.c b/gst-libs/gst/gl/gstglslstage.c
index 05fde1039..581320126 100644
--- a/gst-libs/gst/gl/gstglslstage.c
+++ b/gst-libs/gst/gl/gstglslstage.c
@@ -312,8 +312,7 @@ gst_glsl_stage_set_strings (GstGLSLStage * stage, GstGLSLVersion version,
if (stage->priv->n_strings < n_strings) {
/* only realloc if we need more space */
- if (stage->priv->strings)
- g_free (stage->priv->strings);
+ g_free (stage->priv->strings);
stage->priv->strings = g_new0 (gchar *, n_strings);
}
diff --git a/gst-libs/gst/gl/gstglutils.c b/gst-libs/gst/gl/gstglutils.c
index ae48d7c31..a57bbda0d 100644
--- a/gst-libs/gst/gl/gstglutils.c
+++ b/gst-libs/gst/gl/gstglutils.c
@@ -461,8 +461,7 @@ gst_gl_context_set_error (GstGLContext * context, const char *format, ...)
{
va_list args;
- if (error_message)
- g_free (error_message);
+ g_free (error_message);
va_start (args, format);
error_message = g_strdup_vprintf (format, args);
diff --git a/gst-libs/gst/gl/x11/gstgldisplay_x11.c b/gst-libs/gst/gl/x11/gstgldisplay_x11.c
index e6086b783..696929eb8 100644
--- a/gst-libs/gst/gl/x11/gstgldisplay_x11.c
+++ b/gst-libs/gst/gl/x11/gstgldisplay_x11.c
@@ -55,8 +55,7 @@ gst_gl_display_x11_finalize (GObject * object)
{
GstGLDisplayX11 *display_x11 = GST_GL_DISPLAY_X11 (object);
- if (display_x11->name)
- g_free (display_x11->name);
+ g_free (display_x11->name);
if (!display_x11->foreign_display && display_x11->display) {
XCloseDisplay (display_x11->display);
diff --git a/gst/audiovisualizers/gstwavescope.c b/gst/audiovisualizers/gstwavescope.c
index b87d05cf8..4b7fe3aac 100644
--- a/gst/audiovisualizers/gstwavescope.c
+++ b/gst/audiovisualizers/gstwavescope.c
@@ -176,8 +176,7 @@ gst_wave_scope_setup (GstAudioVisualizer * bscope)
{
GstWaveScope *scope = GST_WAVE_SCOPE (bscope);
- if (scope->flt)
- g_free (scope->flt);
+ g_free (scope->flt);
scope->flt = g_new0 (gdouble, 6 * GST_AUDIO_INFO_CHANNELS (&bscope->ainfo));
diff --git a/gst/dvbsuboverlay/dvb-sub.c b/gst/dvbsuboverlay/dvb-sub.c
index 65a43abda..75965631a 100644
--- a/gst/dvbsuboverlay/dvb-sub.c
+++ b/gst/dvbsuboverlay/dvb-sub.c
@@ -277,8 +277,7 @@ delete_state (DvbSub * dvb_sub)
dvb_sub->region_list = region->next;
delete_region_display_list (dvb_sub, region);
- if (region->pbuf)
- g_free (region->pbuf);
+ g_free (region->pbuf);
g_slice_free (DVBSubRegion, region);
}
@@ -472,8 +471,7 @@ _dvb_sub_parse_region_segment (DvbSub * dvb_sub, guint16 page_id, guint8 * buf,
buf += 2;
if (region->width * region->height != region->buf_size) { /* FIXME: Read closer from spec what happens when dimensions change */
- if (region->pbuf)
- g_free (region->pbuf);
+ g_free (region->pbuf);
region->buf_size = region->width * region->height;
diff --git a/gst/librfb/rfbdecoder.c b/gst/librfb/rfbdecoder.c
index 88f3b0382..bd225ada7 100644
--- a/gst/librfb/rfbdecoder.c
+++ b/gst/librfb/rfbdecoder.c
@@ -89,8 +89,7 @@ rfb_decoder_free (RfbDecoder * decoder)
g_clear_error (&decoder->error);
- if (decoder->data)
- g_free (decoder->data);
+ g_free (decoder->data);
g_free (decoder);
}
@@ -234,8 +233,7 @@ rfb_decoder_read (RfbDecoder * decoder, guint32 len)
g_return_val_if_fail (len > 0, NULL);
if (G_UNLIKELY (len > decoder->data_len)) {
- if (decoder->data)
- g_free (decoder->data);
+ g_free (decoder->data);
decoder->data = g_malloc (len);
decoder->data_len = len;
}
diff --git a/gst/mpegtsdemux/mpegtspacketizer.c b/gst/mpegtsdemux/mpegtspacketizer.c
index ce417c335..3e348a64c 100644
--- a/gst/mpegtsdemux/mpegtspacketizer.c
+++ b/gst/mpegtsdemux/mpegtspacketizer.c
@@ -212,8 +212,7 @@ mpegts_packetizer_clear_section (MpegTSPacketizerStream * stream)
stream->section_length = 0;
stream->section_offset = 0;
stream->table_id = TABLE_ID_UNSET;
- if (stream->section_data)
- g_free (stream->section_data);
+ g_free (stream->section_data);
stream->section_data = NULL;
}
diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c
index f1045da22..fb8e6ac34 100644
--- a/gst/mpegtsdemux/tsdemux.c
+++ b/gst/mpegtsdemux/tsdemux.c
@@ -1579,8 +1579,7 @@ done:
gst_pad_set_event_function (pad, gst_ts_demux_srcpad_event);
}
- if (name)
- g_free (name);
+ g_free (name);
if (template)
gst_object_unref (template);
if (caps)
@@ -1714,8 +1713,7 @@ gst_ts_demux_stream_flush (TSDemuxStream * stream, GstTSDemux * tsdemux,
{
GST_DEBUG ("flushing stream %p", stream);
- if (stream->data)
- g_free (stream->data);
+ g_free (stream->data);
stream->data = NULL;
stream->state = PENDING_PACKET_EMPTY;
stream->expected_size = 0;
diff --git a/gst/mpegtsmux/tsmux/tsmux.c b/gst/mpegtsmux/tsmux/tsmux.c
index 293aed943..00e1203e9 100644
--- a/gst/mpegtsmux/tsmux/tsmux.c
+++ b/gst/mpegtsmux/tsmux/tsmux.c
@@ -934,8 +934,7 @@ tsmux_section_write_packet (GstMpegtsSectionType * type,
return TRUE;
fail:
- if (packet)
- g_free (packet);
+ g_free (packet);
if (section_buffer)
gst_buffer_unref (section_buffer);
return FALSE;
diff --git a/sys/acmenc/acmenc.c b/sys/acmenc/acmenc.c
index 99a080424..67f5efb34 100644
--- a/sys/acmenc/acmenc.c
+++ b/sys/acmenc/acmenc.c
@@ -261,10 +261,8 @@ acmenc_teardown (ACMEnc * enc)
gst_caps_unref (enc->output_caps);
enc->output_caps = NULL;
}
- if (enc->header.pbSrc)
- g_free (enc->header.pbSrc);
- if (enc->header.pbDst)
- g_free (enc->header.pbDst);
+ g_free (enc->header.pbSrc);
+ g_free (enc->header.pbDst);
memset (&enc->header, 0, sizeof (enc->header));
if (enc->stream) {
acmStreamClose (enc->stream, 0);
diff --git a/sys/acmmp3dec/acmmp3dec.c b/sys/acmmp3dec/acmmp3dec.c
index e6d34baa7..737d4a001 100644
--- a/sys/acmmp3dec/acmmp3dec.c
+++ b/sys/acmmp3dec/acmmp3dec.c
@@ -201,10 +201,8 @@ acmmp3dec_teardown (ACMMP3Dec * dec)
if (dec->header.fdwStatus & ACMSTREAMHEADER_STATUSF_PREPARED)
acmStreamUnprepareHeader (dec->stream, &dec->header, 0);
- if (dec->header.pbSrc)
- g_free (dec->header.pbSrc);
- if (dec->header.pbDst)
- g_free (dec->header.pbDst);
+ g_free (dec->header.pbSrc);
+ g_free (dec->header.pbDst);
memset (&dec->header, 0, sizeof (dec->header));
if (dec->stream) {
diff --git a/sys/applemedia/avfassetsrc.m b/sys/applemedia/avfassetsrc.m
index 0aaf3adcf..81931a4e4 100644
--- a/sys/applemedia/avfassetsrc.m
+++ b/sys/applemedia/avfassetsrc.m
@@ -208,9 +208,7 @@ gst_avf_asset_src_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_URI:
- if (self->uri) {
- g_free (self->uri);
- }
+ g_free (self->uri);
self->uri = g_value_dup_string (value);
break;
default:
@@ -820,9 +818,7 @@ gst_avf_asset_src_uri_set_uri (GstURIHandler * handler, const gchar * uri, GErro
if (asset.playable) {
ret = TRUE;
- if (self->uri) {
- g_free (self->uri);
- }
+ g_free (self->uri);
self->uri = g_strdup (uri);
} else {
g_set_error (error, GST_URI_ERROR, GST_URI_ERROR_BAD_URI,
diff --git a/sys/bluez/gsta2dpsink.c b/sys/bluez/gsta2dpsink.c
index 7b9f92245..424b56c19 100644
--- a/sys/bluez/gsta2dpsink.c
+++ b/sys/bluez/gsta2dpsink.c
@@ -157,8 +157,7 @@ gst_a2dp_sink_set_property (GObject * object, guint prop_id,
if (self->sink != NULL)
gst_avdtp_sink_set_device (self->sink, g_value_get_string (value));
- if (self->device != NULL)
- g_free (self->device);
+ g_free (self->device);
self->device = g_value_dup_string (value);
break;
@@ -166,8 +165,7 @@ gst_a2dp_sink_set_property (GObject * object, guint prop_id,
if (self->sink != NULL)
gst_avdtp_sink_set_transport (self->sink, g_value_get_string (value));
- if (self->transport != NULL)
- g_free (self->transport);
+ g_free (self->transport);
self->transport = g_value_dup_string (value);
break;
diff --git a/sys/bluez/gstavdtpsink.c b/sys/bluez/gstavdtpsink.c
index 70dc742a5..0f72a743a 100644
--- a/sys/bluez/gstavdtpsink.c
+++ b/sys/bluez/gstavdtpsink.c
@@ -451,8 +451,7 @@ gst_avdtp_sink_get_link_mtu (GstAvdtpSink * sink)
void
gst_avdtp_sink_set_device (GstAvdtpSink * self, const gchar * dev)
{
- if (self->conn.device != NULL)
- g_free (self->conn.device);
+ g_free (self->conn.device);
GST_LOG_OBJECT (self, "Setting device: %s", dev);
self->conn.device = g_strdup (dev);
@@ -461,8 +460,7 @@ gst_avdtp_sink_set_device (GstAvdtpSink * self, const gchar * dev)
void
gst_avdtp_sink_set_transport (GstAvdtpSink * self, const gchar * trans)
{
- if (self->conn.transport != NULL)
- g_free (self->conn.transport);
+ g_free (self->conn.transport);
GST_LOG_OBJECT (self, "Setting transport: %s", trans);
self->conn.transport = g_strdup (trans);
diff --git a/sys/bluez/gstavdtputil.c b/sys/bluez/gstavdtputil.c
index a435c6a2a..efc4f4298 100644
--- a/sys/bluez/gstavdtputil.c
+++ b/sys/bluez/gstavdtputil.c
@@ -213,8 +213,7 @@ gst_avdtp_connection_reset (GstAvdtpConnection * conn)
void
gst_avdtp_connection_set_device (GstAvdtpConnection * conn, const char *device)
{
- if (conn->device)
- g_free (conn->device);
+ g_free (conn->device);
conn->device = g_strdup (device);
}
@@ -223,8 +222,7 @@ void
gst_avdtp_connection_set_transport (GstAvdtpConnection * conn,
const char *transport)
{
- if (conn->transport)
- g_free (conn->transport);
+ g_free (conn->transport);
conn->transport = g_strdup (transport);
}
diff --git a/sys/dshowdecwrapper/gstdshowaudiodec.cpp b/sys/dshowdecwrapper/gstdshowaudiodec.cpp
index caebec537..9fb83e5be 100644
--- a/sys/dshowdecwrapper/gstdshowaudiodec.cpp
+++ b/sys/dshowdecwrapper/gstdshowaudiodec.cpp
@@ -854,8 +854,7 @@ dshowaudiodec_set_output_format (GstDshowAudioDec *adec)
static void
dshowadec_free_mediatype (AM_MEDIA_TYPE *mediatype)
{
- if (mediatype->pbFormat)
- g_free (mediatype->pbFormat);
+ g_free (mediatype->pbFormat);
g_free (mediatype);
}
diff --git a/sys/dshowdecwrapper/gstdshowvideodec.cpp b/sys/dshowdecwrapper/gstdshowvideodec.cpp
index eac0f724c..9c2f59cfc 100644
--- a/sys/dshowdecwrapper/gstdshowvideodec.cpp
+++ b/sys/dshowdecwrapper/gstdshowvideodec.cpp
@@ -845,8 +845,7 @@ end:
if (caps_out)
gst_caps_unref (caps_out);
gst_object_unref (vdec);
- if (input_vheader)
- g_free (input_vheader);
+ g_free (input_vheader);
if (srcfilter)
srcfilter->Release();
if (sinkfilter)
diff --git a/sys/dshowsrcwrapper/gstdshow.cpp b/sys/dshowsrcwrapper/gstdshow.cpp
index 4b658a349..705adc956 100644
--- a/sys/dshowsrcwrapper/gstdshow.cpp
+++ b/sys/dshowsrcwrapper/gstdshow.cpp
@@ -271,14 +271,12 @@ gst_dshow_find_filter (CLSID input_majortype, CLSID input_subtype,
filter_temp->Release ();
}
- if (friendly_name)
- g_free (friendly_name);
+ g_free (friendly_name);
moniker->Release ();
}
clean:
- if (prefered_filter_upper)
- g_free (prefered_filter_upper);
+ g_free (prefered_filter_upper);
if (enum_moniker)
enum_moniker->Release ();
if (mapper)
diff --git a/sys/dshowsrcwrapper/gstdshowvideosrc.cpp b/sys/dshowsrcwrapper/gstdshowvideosrc.cpp
index 846c050d1..7725fcb1a 100644
--- a/sys/dshowsrcwrapper/gstdshowvideosrc.cpp
+++ b/sys/dshowsrcwrapper/gstdshowvideosrc.cpp
@@ -396,9 +396,7 @@ gst_dshowvideosrc_get_caps (GstBaseSrc * basesrc, GstCaps * filter)
}
}
- if (unidevice) {
- g_free (unidevice);
- }
+ g_free (unidevice);
if (src->caps) {
GstCaps *caps;
diff --git a/sys/dshowvideosink/dshowvideosink.cpp b/sys/dshowvideosink/dshowvideosink.cpp
index cd7b2120a..c3d4bc341 100644
--- a/sys/dshowvideosink/dshowvideosink.cpp
+++ b/sys/dshowvideosink/dshowvideosink.cpp
@@ -285,8 +285,7 @@ gst_dshowvideosink_finalize (GObject * gobject)
{
GstDshowVideoSink *sink = GST_DSHOWVIDEOSINK (gobject);
- if (sink->preferredrenderer)
- g_free (sink->preferredrenderer);
+ g_free (sink->preferredrenderer);
/* signal the COM thread that it sould uninitialize COM */
if (sink->comInitialized) {
@@ -315,9 +314,7 @@ gst_dshowvideosink_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_RENDERER:
- if (sink->preferredrenderer)
- g_free (sink->preferredrenderer);
-
+ g_free (sink->preferredrenderer);
sink->preferredrenderer = g_value_dup_string (value);
break;
case PROP_KEEP_ASPECT_RATIO:
diff --git a/sys/dvb/camswclient.c b/sys/dvb/camswclient.c
index f5d07cf9b..68a3d43eb 100644
--- a/sys/dvb/camswclient.c
+++ b/sys/dvb/camswclient.c
@@ -52,8 +52,7 @@ reset_state (CamSwClient * client)
if (client->sock)
close (client->sock);
- if (client->sock_path)
- g_free (client->sock_path);
+ g_free (client->sock_path);
}
void
diff --git a/sys/dvb/dvbbasebin.c b/sys/dvb/dvbbasebin.c
index 2e6dcfd45..f003355ff 100644
--- a/sys/dvb/dvbbasebin.c
+++ b/sys/dvb/dvbbasebin.c
@@ -597,8 +597,7 @@ dvb_base_bin_set_program_numbers (DvbBaseBin * dvbbasebin, const gchar * pn)
/* FIXME : Deactivate programs no longer selected */
- if (dvbbasebin->program_numbers)
- g_free (dvbbasebin->program_numbers);
+ g_free (dvbbasebin->program_numbers);
dvbbasebin->program_numbers = g_strdup (pn);
if (0)
diff --git a/sys/dvb/parsechannels.c b/sys/dvb/parsechannels.c
index 1a8158204..1d3058090 100644
--- a/sys/dvb/parsechannels.c
+++ b/sys/dvb/parsechannels.c
@@ -180,8 +180,7 @@ no_channels:
static gboolean
remove_channel_from_hash (gpointer key, gpointer value, gpointer user_data)
{
- if (key)
- g_free (key);
+ g_free (key);
if (value)
g_hash_table_destroy ((GHashTable *) value);
return TRUE;
diff --git a/sys/pvr2d/gstpvrvideosink.c b/sys/pvr2d/gstpvrvideosink.c
index 6d117fb90..7c1024376 100644
--- a/sys/pvr2d/gstpvrvideosink.c
+++ b/sys/pvr2d/gstpvrvideosink.c
@@ -1316,11 +1316,8 @@ gst_pvrvideosink_dcontext_free (GstDrawContext * dcontext)
{
GST_DEBUG ("Freeing dcontext %p", dcontext);
- if (dcontext->p_blt_info)
- g_free (dcontext->p_blt_info);
-
- if (dcontext->p_blt2d_info)
- g_free (dcontext->p_blt2d_info);
+ g_free (dcontext->p_blt_info);
+ g_free (dcontext->p_blt2d_info);
if (dcontext->x_lock)
g_mutex_lock (dcontext->x_lock);
diff --git a/sys/uvch264/gstuvch264_mjpgdemux.c b/sys/uvch264/gstuvch264_mjpgdemux.c
index 99734ad5a..1f9b1c405 100644
--- a/sys/uvch264/gstuvch264_mjpgdemux.c
+++ b/sys/uvch264/gstuvch264_mjpgdemux.c
@@ -296,8 +296,7 @@ gst_uvc_h264_mjpg_demux_dispose (GObject * object)
if (self->priv->nv12_caps)
gst_caps_unref (self->priv->nv12_caps);
self->priv->nv12_caps = NULL;
- if (self->priv->clock_samples)
- g_free (self->priv->clock_samples);
+ g_free (self->priv->clock_samples);
self->priv->clock_samples = NULL;
G_OBJECT_CLASS (parent_class)->dispose (object);
diff --git a/sys/vdpau/gstvdpvideomemory.c b/sys/vdpau/gstvdpvideomemory.c
index 8d0fa5122..8217653d2 100644
--- a/sys/vdpau/gstvdpvideomemory.c
+++ b/sys/vdpau/gstvdpvideomemory.c
@@ -222,8 +222,7 @@ _vdp_video_mem_free (GstAllocator * allocator, GstMemory * mem)
gst_object_unref (vmem->device);
- if (vmem->cache)
- g_free (vmem->cache);
+ g_free (vmem->cache);
g_slice_free (GstVdpVideoMemory, vmem);
}
diff --git a/tests/examples/gtk/glliveshader.c b/tests/examples/gtk/glliveshader.c
index 6f820a63a..d8c8d3506 100644
--- a/tests/examples/gtk/glliveshader.c
+++ b/tests/examples/gtk/glliveshader.c
@@ -233,8 +233,7 @@ _on_text_changed (GtkTextBuffer * text, struct text_view_state *state)
GtkTextIter start, end;
gtk_text_buffer_get_bounds (text, &start, &end);
- if (state->str)
- g_free (state->str);
+ g_free (state->str);
state->str = gtk_text_buffer_get_text (text, &start, &end, FALSE);
g_object_set (state->state->shader, "update-shader", TRUE, NULL);
}
diff --git a/tests/icles/metadata_editor.c b/tests/icles/metadata_editor.c
index 7266a7d33..7352e7ba8 100644
--- a/tests/icles/metadata_editor.c
+++ b/tests/icles/metadata_editor.c
@@ -201,8 +201,7 @@ insert_tag_on_tree (const GstTagList * list, const gchar * tag,
gtk_tree_store_append (tree_store, &iter, NULL);
gtk_tree_store_set (tree_store, &iter, COL_TAG, tag, COL_VALUE, str, -1);
- if (str)
- g_free (str);
+ g_free (str);
}