Remove unnecessary NULL checks before g_free()

g_free() is NULL-safe
This commit is contained in:
Reynaldo H. Verdejo Pinochet 2015-11-17 15:23:17 -08:00
parent 87b5ad0dfc
commit 86ec812429
48 changed files with 73 additions and 151 deletions

View file

@ -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 */ /* the element must be stopped or paused in order to do this */
g_return_if_fail ((GST_STATE (sink) < GST_STATE_PLAYING) g_return_if_fail ((GST_STATE (sink) < GST_STATE_PLAYING)
|| (GST_STATE (sink) == GST_STATE_PAUSED)); || (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)); sink->filename = g_strdup (g_value_get_string (value));
if ((GST_STATE (sink) == GST_STATE_PAUSED) if ((GST_STATE (sink) == GST_STATE_PAUSED)
&& (sink->filename != NULL)) { && (sink->filename != NULL)) {

View file

@ -250,8 +250,7 @@ gst_afsrc_set_property (GObject * object, guint prop_id, const GValue * value,
switch (prop_id) { switch (prop_id) {
case ARG_LOCATION: case ARG_LOCATION:
if (src->filename) g_free (src->filename);
g_free (src->filename);
src->filename = g_strdup (g_value_get_string (value)); src->filename = g_strdup (g_value_get_string (value));
break; break;
default: default:

View file

@ -3366,8 +3366,7 @@ combine_urls (GstUri * base, GList * list, gchar ** query, guint idx)
gst_uri_unref (base); gst_uri_unref (base);
if (ret && query) { if (ret && query) {
if (*query) g_free (*query);
g_free (*query);
*query = gst_uri_get_query_string (ret); *query = gst_uri_get_query_string (ret);
if (*query) { if (*query) {
ret = gst_uri_make_writable (ret); ret = gst_uri_make_writable (ret);

View file

@ -329,8 +329,7 @@ gst_gl_bumper_set_property (GObject * object, guint prop_id,
switch (prop_id) { switch (prop_id) {
case PROP_LOCATION: case PROP_LOCATION:
if (bumper->location != NULL) g_free (bumper->location);
g_free (bumper->location);
bumper->location = g_value_dup_string (value); bumper->location = g_value_dup_string (value);
break; break;
default: default:

View file

@ -236,8 +236,7 @@ gst_gl_differencematte_set_property (GObject * object, guint prop_id,
switch (prop_id) { switch (prop_id) {
case PROP_LOCATION: case PROP_LOCATION:
if (differencematte->location != NULL) g_free (differencematte->location);
g_free (differencematte->location);
differencematte->bg_has_changed = TRUE; differencematte->bg_has_changed = TRUE;
differencematte->location = g_value_dup_string (value); differencematte->location = g_value_dup_string (value);
break; break;

View file

@ -164,12 +164,10 @@ gst_gl_filtershader_finalize (GObject * object)
{ {
GstGLFilterShader *filtershader = GST_GL_FILTERSHADER (object); GstGLFilterShader *filtershader = GST_GL_FILTERSHADER (object);
if (filtershader->vertex) g_free (filtershader->vertex);
g_free (filtershader->vertex);
filtershader->vertex = NULL; filtershader->vertex = NULL;
if (filtershader->fragment) g_free (filtershader->fragment);
g_free (filtershader->fragment);
filtershader->fragment = NULL; filtershader->fragment = NULL;
if (filtershader->uniforms) if (filtershader->uniforms)
@ -195,16 +193,14 @@ gst_gl_filtershader_set_property (GObject * object, guint prop_id,
break; break;
case PROP_VERTEX: case PROP_VERTEX:
GST_OBJECT_LOCK (filtershader); GST_OBJECT_LOCK (filtershader);
if (filtershader->vertex) g_free (filtershader->vertex);
g_free (filtershader->vertex);
filtershader->vertex = g_value_dup_string (value); filtershader->vertex = g_value_dup_string (value);
filtershader->new_source = TRUE; filtershader->new_source = TRUE;
GST_OBJECT_UNLOCK (filtershader); GST_OBJECT_UNLOCK (filtershader);
break; break;
case PROP_FRAGMENT: case PROP_FRAGMENT:
GST_OBJECT_LOCK (filtershader); GST_OBJECT_LOCK (filtershader);
if (filtershader->fragment) g_free (filtershader->fragment);
g_free (filtershader->fragment);
filtershader->fragment = g_value_dup_string (value); filtershader->fragment = g_value_dup_string (value);
filtershader->new_source = TRUE; filtershader->new_source = TRUE;
GST_OBJECT_UNLOCK (filtershader); GST_OBJECT_UNLOCK (filtershader);

View file

@ -277,8 +277,7 @@ gst_gl_overlay_set_property (GObject * object, guint prop_id,
switch (prop_id) { switch (prop_id) {
case PROP_LOCATION: case PROP_LOCATION:
if (overlay->location != NULL) g_free (overlay->location);
g_free (overlay->location);
overlay->location_has_changed = TRUE; overlay->location_has_changed = TRUE;
overlay->location = g_value_dup_string (value); overlay->location = g_value_dup_string (value);
break; break;

View file

@ -674,11 +674,9 @@ gst_hls_demux_update_fragment_info (GstAdaptiveDemuxStream * stream)
stream->fragment.timestamp = GST_CLOCK_TIME_NONE; 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; hlsdemux->current_key = key;
if (hlsdemux->current_iv) g_free (hlsdemux->current_iv);
g_free (hlsdemux->current_iv);
hlsdemux->current_iv = iv; hlsdemux->current_iv = iv;
g_free (stream->fragment.uri); g_free (stream->fragment.uri);
stream->fragment.uri = next_fragment_uri; stream->fragment.uri = next_fragment_uri;

View file

@ -791,12 +791,9 @@ gst_kate_enc_chain_spu (GstKateEnc * ke, GstBuffer * buf)
kbitmap = (kate_bitmap *) g_malloc (sizeof (kate_bitmap)); kbitmap = (kate_bitmap *) g_malloc (sizeof (kate_bitmap));
kpalette = (kate_palette *) g_malloc (sizeof (kate_palette)); kpalette = (kate_palette *) g_malloc (sizeof (kate_palette));
if (!kregion || !kpalette || !kbitmap) { if (!kregion || !kpalette || !kbitmap) {
if (kregion) g_free (kregion);
g_free (kregion); g_free (kbitmap);
if (kbitmap) g_free (kpalette);
g_free (kbitmap);
if (kpalette)
g_free (kpalette);
GST_ELEMENT_ERROR (ke, STREAM, ENCODE, (NULL), ("Out of memory")); GST_ELEMENT_ERROR (ke, STREAM, ENCODE, (NULL), ("Out of memory"));
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }

View file

@ -911,7 +911,6 @@ gst_kate_spu_encode_spu (GstKateDec * kd, const kate_event * ev)
error: error:
kate_tracker_clear (&kin); kate_tracker_clear (&kin);
if (bytes) g_free (bytes);
g_free (bytes);
return NULL; return NULL;
} }

View file

@ -371,11 +371,9 @@ gst_kate_util_decoder_base_chain_kate_packet (GstKateDecoderBase * decoder,
} }
/* update properties */ /* update properties */
if (decoder->language) g_free (decoder->language);
g_free (decoder->language);
decoder->language = g_strdup (decoder->k.ki->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->category = g_strdup (decoder->k.ki->category);
decoder->original_canvas_width = decoder->k.ki->original_canvas_width; decoder->original_canvas_width = decoder->k.ki->original_canvas_width;
decoder->original_canvas_height = decoder->k.ki->original_canvas_height; decoder->original_canvas_height = decoder->k.ki->original_canvas_height;

View file

@ -609,8 +609,7 @@ gst_mms_uri_set_uri (GstURIHandler * handler, const gchar * uri,
} }
GST_OBJECT_LOCK (src); GST_OBJECT_LOCK (src);
if (src->uri_name) g_free (src->uri_name);
g_free (src->uri_name);
src->uri_name = fixed_uri; src->uri_name = fixed_uri;
GST_OBJECT_UNLOCK (src); GST_OBJECT_UNLOCK (src);

View file

@ -321,8 +321,7 @@ gst_neonhttp_src_set_property (GObject * object, guint prop_id,
break; break;
} }
case PROP_USER_AGENT: 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)); src->user_agent = g_strdup (g_value_get_string (value));
break; break;
case PROP_COOKIES: case PROP_COOKIES:

View file

@ -1091,8 +1091,7 @@ done:
if (bdata) if (bdata)
gst_buffer_unmap (buf, &map); gst_buffer_unmap (buf, &map);
if (mdata) g_free (mdata);
g_free (mdata);
return ret; return ret;
} }

View file

@ -148,8 +148,7 @@ gst_sf_sink_set_location (GstSFSink * this, const gchar * location)
if (this->file) if (this->file)
goto was_open; goto was_open;
if (this->location) g_free (this->location);
g_free (this->location);
this->location = location ? g_strdup (location) : NULL; this->location = location ? g_strdup (location) : NULL;

View file

@ -146,8 +146,7 @@ gst_sf_src_set_location (GstSFSrc * this, const gchar * location)
if (this->file) if (this->file)
goto was_open; goto was_open;
if (this->location) g_free (this->location);
g_free (this->location);
this->location = location ? g_strdup (location) : NULL; this->location = location ? g_strdup (location) : NULL;

View file

@ -328,20 +328,13 @@ spc_tag_get_info (guchar * data, guint length, spc_tag_info * info)
void void
spc_tag_free (spc_tag_info * info) spc_tag_free (spc_tag_info * info)
{ {
if (info->title) g_free (info->title);
g_free (info->title); g_free (info->game);
if (info->game) g_free (info->artist);
g_free (info->game); g_free (info->album);
if (info->artist) g_free (info->publisher);
g_free (info->artist); g_free (info->comment);
if (info->album) g_free (info->dumper);
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);
if (info->dump_date) if (info->dump_date)
g_date_free (info->dump_date); g_date_free (info->dump_date);
} }

View file

@ -588,8 +588,7 @@ gst_timidity_loop (GstPad * sinkpad)
goto paused; goto paused;
} }
if (timidity->mididata) g_free (timidity->mididata);
g_free (timidity->mididata);
timidity->mididata = g_malloc (timidity->mididata_size); timidity->mididata = g_malloc (timidity->mididata_size);
timidity->mididata_offset = 0; timidity->mididata_offset = 0;

View file

@ -219,8 +219,7 @@ gst_wayland_sink_finalize (GObject * object)
if (sink->pool) if (sink->pool)
gst_object_unref (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->display_lock);
g_mutex_clear (&sink->render_lock); g_mutex_clear (&sink->render_lock);

View file

@ -189,8 +189,7 @@ _gst_gl_feature_check (GstGLContext * context,
for (func_num = 0; data->functions[func_num].name; func_num++) { for (func_num = 0; data->functions[func_num].name; func_num++) {
void *func; 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, full_function_name = g_strconcat ("gl", data->functions[func_num].name,
suffix, NULL); suffix, NULL);

View file

@ -312,8 +312,7 @@ gst_glsl_stage_set_strings (GstGLSLStage * stage, GstGLSLVersion version,
if (stage->priv->n_strings < n_strings) { if (stage->priv->n_strings < n_strings) {
/* only realloc if we need more space */ /* 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); stage->priv->strings = g_new0 (gchar *, n_strings);
} }

View file

@ -461,8 +461,7 @@ gst_gl_context_set_error (GstGLContext * context, const char *format, ...)
{ {
va_list args; va_list args;
if (error_message) g_free (error_message);
g_free (error_message);
va_start (args, format); va_start (args, format);
error_message = g_strdup_vprintf (format, args); error_message = g_strdup_vprintf (format, args);

View file

@ -55,8 +55,7 @@ gst_gl_display_x11_finalize (GObject * object)
{ {
GstGLDisplayX11 *display_x11 = GST_GL_DISPLAY_X11 (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) { if (!display_x11->foreign_display && display_x11->display) {
XCloseDisplay (display_x11->display); XCloseDisplay (display_x11->display);

View file

@ -176,8 +176,7 @@ gst_wave_scope_setup (GstAudioVisualizer * bscope)
{ {
GstWaveScope *scope = GST_WAVE_SCOPE (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)); scope->flt = g_new0 (gdouble, 6 * GST_AUDIO_INFO_CHANNELS (&bscope->ainfo));

View file

@ -277,8 +277,7 @@ delete_state (DvbSub * dvb_sub)
dvb_sub->region_list = region->next; dvb_sub->region_list = region->next;
delete_region_display_list (dvb_sub, region); delete_region_display_list (dvb_sub, region);
if (region->pbuf) g_free (region->pbuf);
g_free (region->pbuf);
g_slice_free (DVBSubRegion, region); g_slice_free (DVBSubRegion, region);
} }
@ -472,8 +471,7 @@ _dvb_sub_parse_region_segment (DvbSub * dvb_sub, guint16 page_id, guint8 * buf,
buf += 2; buf += 2;
if (region->width * region->height != region->buf_size) { /* FIXME: Read closer from spec what happens when dimensions change */ 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; region->buf_size = region->width * region->height;

View file

@ -89,8 +89,7 @@ rfb_decoder_free (RfbDecoder * decoder)
g_clear_error (&decoder->error); g_clear_error (&decoder->error);
if (decoder->data) g_free (decoder->data);
g_free (decoder->data);
g_free (decoder); g_free (decoder);
} }
@ -234,8 +233,7 @@ rfb_decoder_read (RfbDecoder * decoder, guint32 len)
g_return_val_if_fail (len > 0, NULL); g_return_val_if_fail (len > 0, NULL);
if (G_UNLIKELY (len > decoder->data_len)) { 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 = g_malloc (len);
decoder->data_len = len; decoder->data_len = len;
} }

View file

@ -212,8 +212,7 @@ mpegts_packetizer_clear_section (MpegTSPacketizerStream * stream)
stream->section_length = 0; stream->section_length = 0;
stream->section_offset = 0; stream->section_offset = 0;
stream->table_id = TABLE_ID_UNSET; stream->table_id = TABLE_ID_UNSET;
if (stream->section_data) g_free (stream->section_data);
g_free (stream->section_data);
stream->section_data = NULL; stream->section_data = NULL;
} }

View file

@ -1579,8 +1579,7 @@ done:
gst_pad_set_event_function (pad, gst_ts_demux_srcpad_event); gst_pad_set_event_function (pad, gst_ts_demux_srcpad_event);
} }
if (name) g_free (name);
g_free (name);
if (template) if (template)
gst_object_unref (template); gst_object_unref (template);
if (caps) if (caps)
@ -1714,8 +1713,7 @@ gst_ts_demux_stream_flush (TSDemuxStream * stream, GstTSDemux * tsdemux,
{ {
GST_DEBUG ("flushing stream %p", stream); GST_DEBUG ("flushing stream %p", stream);
if (stream->data) g_free (stream->data);
g_free (stream->data);
stream->data = NULL; stream->data = NULL;
stream->state = PENDING_PACKET_EMPTY; stream->state = PENDING_PACKET_EMPTY;
stream->expected_size = 0; stream->expected_size = 0;

View file

@ -934,8 +934,7 @@ tsmux_section_write_packet (GstMpegtsSectionType * type,
return TRUE; return TRUE;
fail: fail:
if (packet) g_free (packet);
g_free (packet);
if (section_buffer) if (section_buffer)
gst_buffer_unref (section_buffer); gst_buffer_unref (section_buffer);
return FALSE; return FALSE;

View file

@ -261,10 +261,8 @@ acmenc_teardown (ACMEnc * enc)
gst_caps_unref (enc->output_caps); gst_caps_unref (enc->output_caps);
enc->output_caps = NULL; enc->output_caps = NULL;
} }
if (enc->header.pbSrc) g_free (enc->header.pbSrc);
g_free (enc->header.pbSrc); g_free (enc->header.pbDst);
if (enc->header.pbDst)
g_free (enc->header.pbDst);
memset (&enc->header, 0, sizeof (enc->header)); memset (&enc->header, 0, sizeof (enc->header));
if (enc->stream) { if (enc->stream) {
acmStreamClose (enc->stream, 0); acmStreamClose (enc->stream, 0);

View file

@ -201,10 +201,8 @@ acmmp3dec_teardown (ACMMP3Dec * dec)
if (dec->header.fdwStatus & ACMSTREAMHEADER_STATUSF_PREPARED) if (dec->header.fdwStatus & ACMSTREAMHEADER_STATUSF_PREPARED)
acmStreamUnprepareHeader (dec->stream, &dec->header, 0); acmStreamUnprepareHeader (dec->stream, &dec->header, 0);
if (dec->header.pbSrc) g_free (dec->header.pbSrc);
g_free (dec->header.pbSrc); g_free (dec->header.pbDst);
if (dec->header.pbDst)
g_free (dec->header.pbDst);
memset (&dec->header, 0, sizeof (dec->header)); memset (&dec->header, 0, sizeof (dec->header));
if (dec->stream) { if (dec->stream) {

View file

@ -208,9 +208,7 @@ gst_avf_asset_src_set_property (GObject * object, guint prop_id,
switch (prop_id) { switch (prop_id) {
case PROP_URI: case PROP_URI:
if (self->uri) { g_free (self->uri);
g_free (self->uri);
}
self->uri = g_value_dup_string (value); self->uri = g_value_dup_string (value);
break; break;
default: default:
@ -820,9 +818,7 @@ gst_avf_asset_src_uri_set_uri (GstURIHandler * handler, const gchar * uri, GErro
if (asset.playable) { if (asset.playable) {
ret = TRUE; ret = TRUE;
if (self->uri) { g_free (self->uri);
g_free (self->uri);
}
self->uri = g_strdup (uri); self->uri = g_strdup (uri);
} else { } else {
g_set_error (error, GST_URI_ERROR, GST_URI_ERROR_BAD_URI, g_set_error (error, GST_URI_ERROR, GST_URI_ERROR_BAD_URI,

View file

@ -157,8 +157,7 @@ gst_a2dp_sink_set_property (GObject * object, guint prop_id,
if (self->sink != NULL) if (self->sink != NULL)
gst_avdtp_sink_set_device (self->sink, g_value_get_string (value)); 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); self->device = g_value_dup_string (value);
break; break;
@ -166,8 +165,7 @@ gst_a2dp_sink_set_property (GObject * object, guint prop_id,
if (self->sink != NULL) if (self->sink != NULL)
gst_avdtp_sink_set_transport (self->sink, g_value_get_string (value)); 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); self->transport = g_value_dup_string (value);
break; break;

View file

@ -451,8 +451,7 @@ gst_avdtp_sink_get_link_mtu (GstAvdtpSink * sink)
void void
gst_avdtp_sink_set_device (GstAvdtpSink * self, const gchar * dev) 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); GST_LOG_OBJECT (self, "Setting device: %s", dev);
self->conn.device = g_strdup (dev); self->conn.device = g_strdup (dev);
@ -461,8 +460,7 @@ gst_avdtp_sink_set_device (GstAvdtpSink * self, const gchar * dev)
void void
gst_avdtp_sink_set_transport (GstAvdtpSink * self, const gchar * trans) 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); GST_LOG_OBJECT (self, "Setting transport: %s", trans);
self->conn.transport = g_strdup (trans); self->conn.transport = g_strdup (trans);

View file

@ -213,8 +213,7 @@ gst_avdtp_connection_reset (GstAvdtpConnection * conn)
void void
gst_avdtp_connection_set_device (GstAvdtpConnection * conn, const char *device) 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); conn->device = g_strdup (device);
} }
@ -223,8 +222,7 @@ void
gst_avdtp_connection_set_transport (GstAvdtpConnection * conn, gst_avdtp_connection_set_transport (GstAvdtpConnection * conn,
const char *transport) const char *transport)
{ {
if (conn->transport) g_free (conn->transport);
g_free (conn->transport);
conn->transport = g_strdup (transport); conn->transport = g_strdup (transport);
} }

View file

@ -854,8 +854,7 @@ dshowaudiodec_set_output_format (GstDshowAudioDec *adec)
static void static void
dshowadec_free_mediatype (AM_MEDIA_TYPE *mediatype) dshowadec_free_mediatype (AM_MEDIA_TYPE *mediatype)
{ {
if (mediatype->pbFormat) g_free (mediatype->pbFormat);
g_free (mediatype->pbFormat);
g_free (mediatype); g_free (mediatype);
} }

View file

@ -845,8 +845,7 @@ end:
if (caps_out) if (caps_out)
gst_caps_unref (caps_out); gst_caps_unref (caps_out);
gst_object_unref (vdec); gst_object_unref (vdec);
if (input_vheader) g_free (input_vheader);
g_free (input_vheader);
if (srcfilter) if (srcfilter)
srcfilter->Release(); srcfilter->Release();
if (sinkfilter) if (sinkfilter)

View file

@ -271,14 +271,12 @@ gst_dshow_find_filter (CLSID input_majortype, CLSID input_subtype,
filter_temp->Release (); filter_temp->Release ();
} }
if (friendly_name) g_free (friendly_name);
g_free (friendly_name);
moniker->Release (); moniker->Release ();
} }
clean: clean:
if (prefered_filter_upper) g_free (prefered_filter_upper);
g_free (prefered_filter_upper);
if (enum_moniker) if (enum_moniker)
enum_moniker->Release (); enum_moniker->Release ();
if (mapper) if (mapper)

View file

@ -396,9 +396,7 @@ gst_dshowvideosrc_get_caps (GstBaseSrc * basesrc, GstCaps * filter)
} }
} }
if (unidevice) { g_free (unidevice);
g_free (unidevice);
}
if (src->caps) { if (src->caps) {
GstCaps *caps; GstCaps *caps;

View file

@ -285,8 +285,7 @@ gst_dshowvideosink_finalize (GObject * gobject)
{ {
GstDshowVideoSink *sink = GST_DSHOWVIDEOSINK (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 */ /* signal the COM thread that it sould uninitialize COM */
if (sink->comInitialized) { if (sink->comInitialized) {
@ -315,9 +314,7 @@ gst_dshowvideosink_set_property (GObject * object, guint prop_id,
switch (prop_id) { switch (prop_id) {
case PROP_RENDERER: case PROP_RENDERER:
if (sink->preferredrenderer) g_free (sink->preferredrenderer);
g_free (sink->preferredrenderer);
sink->preferredrenderer = g_value_dup_string (value); sink->preferredrenderer = g_value_dup_string (value);
break; break;
case PROP_KEEP_ASPECT_RATIO: case PROP_KEEP_ASPECT_RATIO:

View file

@ -52,8 +52,7 @@ reset_state (CamSwClient * client)
if (client->sock) if (client->sock)
close (client->sock); close (client->sock);
if (client->sock_path) g_free (client->sock_path);
g_free (client->sock_path);
} }
void void

View file

@ -597,8 +597,7 @@ dvb_base_bin_set_program_numbers (DvbBaseBin * dvbbasebin, const gchar * pn)
/* FIXME : Deactivate programs no longer selected */ /* 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); dvbbasebin->program_numbers = g_strdup (pn);
if (0) if (0)

View file

@ -180,8 +180,7 @@ no_channels:
static gboolean static gboolean
remove_channel_from_hash (gpointer key, gpointer value, gpointer user_data) remove_channel_from_hash (gpointer key, gpointer value, gpointer user_data)
{ {
if (key) g_free (key);
g_free (key);
if (value) if (value)
g_hash_table_destroy ((GHashTable *) value); g_hash_table_destroy ((GHashTable *) value);
return TRUE; return TRUE;

View file

@ -1316,11 +1316,8 @@ gst_pvrvideosink_dcontext_free (GstDrawContext * dcontext)
{ {
GST_DEBUG ("Freeing dcontext %p", dcontext); GST_DEBUG ("Freeing dcontext %p", dcontext);
if (dcontext->p_blt_info) g_free (dcontext->p_blt_info);
g_free (dcontext->p_blt_info); g_free (dcontext->p_blt2d_info);
if (dcontext->p_blt2d_info)
g_free (dcontext->p_blt2d_info);
if (dcontext->x_lock) if (dcontext->x_lock)
g_mutex_lock (dcontext->x_lock); g_mutex_lock (dcontext->x_lock);

View file

@ -296,8 +296,7 @@ gst_uvc_h264_mjpg_demux_dispose (GObject * object)
if (self->priv->nv12_caps) if (self->priv->nv12_caps)
gst_caps_unref (self->priv->nv12_caps); gst_caps_unref (self->priv->nv12_caps);
self->priv->nv12_caps = NULL; 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; self->priv->clock_samples = NULL;
G_OBJECT_CLASS (parent_class)->dispose (object); G_OBJECT_CLASS (parent_class)->dispose (object);

View file

@ -222,8 +222,7 @@ _vdp_video_mem_free (GstAllocator * allocator, GstMemory * mem)
gst_object_unref (vmem->device); gst_object_unref (vmem->device);
if (vmem->cache) g_free (vmem->cache);
g_free (vmem->cache);
g_slice_free (GstVdpVideoMemory, vmem); g_slice_free (GstVdpVideoMemory, vmem);
} }

View file

@ -233,8 +233,7 @@ _on_text_changed (GtkTextBuffer * text, struct text_view_state *state)
GtkTextIter start, end; GtkTextIter start, end;
gtk_text_buffer_get_bounds (text, &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); state->str = gtk_text_buffer_get_text (text, &start, &end, FALSE);
g_object_set (state->state->shader, "update-shader", TRUE, NULL); g_object_set (state->state->shader, "update-shader", TRUE, NULL);
} }

View file

@ -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_append (tree_store, &iter, NULL);
gtk_tree_store_set (tree_store, &iter, COL_TAG, tag, COL_VALUE, str, -1); gtk_tree_store_set (tree_store, &iter, COL_TAG, tag, COL_VALUE, str, -1);
if (str) g_free (str);
g_free (str);
} }