diff options
| author | Leandro Pereira <leandro@hardinfo.org> | 2011-12-04 11:56:39 -0200 | 
|---|---|---|
| committer | Leandro Pereira <leandro@hardinfo.org> | 2011-12-04 11:57:02 -0200 | 
| commit | 8e3c3a5eda7817b012423b3faae788b369119834 (patch) | |
| tree | d1b3351d15a49dd51a353e6292ef02fe3fec94e0 | |
| parent | dcf0124ea3a61e9235329dbecce92774224e54f8 (diff) | |
Remove all usages of if (ptr) free(ptr) since free() already performs null-checks.
| -rw-r--r-- | help-viewer/markdown-text-view.c | 3 | ||||
| -rw-r--r-- | modules/devices/sensors.c | 6 | ||||
| -rw-r--r-- | shell/report.c | 6 | ||||
| -rw-r--r-- | shell/syncmanager.c | 6 | 
4 files changed, 7 insertions, 14 deletions
| diff --git a/help-viewer/markdown-text-view.c b/help-viewer/markdown-text-view.c index 6bfcc131..ee1a73b1 100644 --- a/help-viewer/markdown-text-view.c +++ b/help-viewer/markdown-text-view.c @@ -290,8 +290,7 @@ set_cursor_if_appropriate(MarkdownTextView * self, gint x, gint y)          }      } -    if (link_uri) -        g_free(link_uri); +    g_free(link_uri);      if (tags)  	g_slist_free(tags); diff --git a/modules/devices/sensors.c b/modules/devices/sensors.c index 9f02566d..22c67590 100644 --- a/modules/devices/sensors.c +++ b/modules/devices/sensors.c @@ -332,8 +332,7 @@ static void read_sensors_hddtemp(void)  	    gchar **disks;  	    int i; -	    if (old) -		g_free(old); +	    g_free(old);  	    old = g_strdup("[Hard Disk Temperature]\n"); @@ -369,8 +368,7 @@ static void read_sensors_hddtemp(void)  void scan_sensors_do(void)  { -    if (sensors) -	g_free(sensors); +    g_free(sensors);      sensors = g_strdup(""); diff --git a/shell/report.c b/shell/report.c index fb87ee23..fb18c346 100644 --- a/shell/report.c +++ b/shell/report.c @@ -226,8 +226,7 @@ void report_table(ReportContext * ctx, gchar * text)  static void report_html_header(ReportContext * ctx)  { -    if (ctx->output) -	g_free(ctx->output); +    g_free(ctx->output);      ctx->output =  	g_strdup_printf @@ -318,8 +317,7 @@ report_html_key_value(ReportContext * ctx, gchar * key, gchar * value)  static void report_text_header(ReportContext * ctx)  { -    if (ctx->output) -	g_free(ctx->output); +    g_free(ctx->output);      ctx->output = g_strdup("");  } diff --git a/shell/syncmanager.c b/shell/syncmanager.c index 496dc348..ce50d429 100644 --- a/shell/syncmanager.c +++ b/shell/syncmanager.c @@ -326,14 +326,12 @@ static gboolean _action_call_function(SyncDialog * sd, gpointer user_data)  					       VERSION, ARCH,  					       sna->entry->name,  					       str_data, NULL)) { -	    if (str_data) -		g_free(str_data); +	    g_free(str_data);  	    return FALSE;  	} -	if (str_data) -	    g_free(str_data); +	g_free(str_data);      }      return sna->error ? FALSE : TRUE; | 
