pidgin/pidgin

Remove more NULL-checks before free().

2015-12-21, Michael McConville
04cf8cbe44d8
Parents d2f0259aa43f
Children 5061721fd98f
Remove more NULL-checks before free().
--- a/pidgin/gtkmedia.c Mon Dec 21 14:46:12 2015 -0500
+++ b/pidgin/gtkmedia.c Mon Dec 21 14:50:43 2015 -0500
@@ -1125,8 +1125,7 @@
break;
}
case PROP_SCREENNAME:
- if (media->priv->screenname)
- g_free(media->priv->screenname);
+ g_free(media->priv->screenname);
media->priv->screenname = g_value_dup_string(value);
break;
default:
--- a/pidgin/gtkstatusbox.c Mon Dec 21 14:46:12 2015 -0500
+++ b/pidgin/gtkstatusbox.c Mon Dec 21 14:50:43 2015 -0500
@@ -2314,11 +2314,8 @@
{
gtk_widget_hide(status_box->vbox);
status_box->webview_visible = FALSE;
- if (message != NULL)
- {
- g_free(message);
- message = NULL;
- }
+ g_free(message);
+ message = NULL;
}
if (status_box->account == NULL) {
--- a/pidgin/libpidgin.c Mon Dec 21 14:46:12 2015 -0500
+++ b/pidgin/libpidgin.c Mon Dec 21 14:50:43 2015 -0500
@@ -776,14 +776,10 @@
#ifdef USE_SM
pidgin_session_init(argv[0], opt_session_arg, opt_config_dir_arg);
#endif
- if (opt_session_arg != NULL) {
- g_free(opt_session_arg);
- opt_session_arg = NULL;
- }
- if (opt_config_dir_arg != NULL) {
- g_free(opt_config_dir_arg);
- opt_config_dir_arg = NULL;
- }
+ g_free(opt_session_arg);
+ opt_session_arg = NULL;
+ g_free(opt_config_dir_arg);
+ opt_config_dir_arg = NULL;
/* This needs to be before purple_blist_show() so the
* statusbox gets the forced online status. */
@@ -810,10 +806,8 @@
purple_savedstatus_activate(purple_savedstatus_get_startup());
/* now enable the requested ones */
dologin_named(opt_login_arg);
- if (opt_login_arg != NULL) {
- g_free(opt_login_arg);
- opt_login_arg = NULL;
- }
+ g_free(opt_login_arg);
+ opt_login_arg = NULL;
} else if (opt_nologin) {
/* Set all accounts to "offline" */
PurpleSavedStatus *saved_status;
--- a/pidgin/plugins/gestures/stroke-draw.c Mon Dec 21 14:46:12 2015 -0500
+++ b/pidgin/plugins/gestures/stroke-draw.c Mon Dec 21 14:50:43 2015 -0500
@@ -321,8 +321,7 @@
metrics = (struct gstroke_metrics*)g_object_get_data(G_OBJECT(widget),
GSTROKE_METRICS);
- if (metrics)
- g_free (metrics);
+ g_free(metrics);
g_object_steal_data(G_OBJECT(widget), GSTROKE_METRICS);
}