diff options
author | Richard Hughes <richard@hughsie.com> | 2014-11-19 11:18:06 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-11-19 13:45:42 +0000 |
commit | 49170ad2544f4a0a17164f2b622d1e52a86f8ac7 (patch) | |
tree | 009e4ccbd203dee07f42e233395b56d235fb1c0d | |
parent | e86d2976f4b708293e0635ff407da3bd2423bf98 (diff) | |
download | colord-49170ad2544f4a0a17164f2b622d1e52a86f8ac7.tar.gz |
trivial: Silence some invalid _cleanup_free_ warnings
-rw-r--r-- | contrib/colord-sane/cd-main.c | 2 | ||||
-rw-r--r-- | contrib/session-helper/cd-main.c | 28 | ||||
-rw-r--r-- | lib/colord/cd-client.c | 2 | ||||
-rw-r--r-- | lib/colord/cd-icc-store.c | 6 | ||||
-rw-r--r-- | lib/colord/cd-icc.c | 10 | ||||
-rw-r--r-- | lib/colord/cd-it8.c | 4 | ||||
-rw-r--r-- | src/cd-common.c | 2 | ||||
-rw-r--r-- | src/cd-main.c | 38 | ||||
-rw-r--r-- | src/cd-profile.c | 4 | ||||
-rw-r--r-- | src/cd-sensor.c | 2 | ||||
-rw-r--r-- | src/plugins/cd-plugin-camera.c | 2 | ||||
-rw-r--r-- | src/sensors/cd-sensor-colorhug.c | 2 |
12 files changed, 51 insertions, 51 deletions
diff --git a/contrib/colord-sane/cd-main.c b/contrib/colord-sane/cd-main.c index 0a4d2fe..41402f2 100644 --- a/contrib/colord-sane/cd-main.c +++ b/contrib/colord-sane/cd-main.c @@ -101,7 +101,7 @@ cd_main_colord_create_device_cb (GObject *source_object, { CdClient *client = CD_CLIENT (source_object); _cleanup_error_free_ GError *error = NULL; - _cleanup_object_unref_ CdDevice *device; + _cleanup_object_unref_ CdDevice *device = NULL; /* get result */ device = cd_client_create_device_finish (client, res, &error); diff --git a/contrib/session-helper/cd-main.c b/contrib/session-helper/cd-main.c index 5b44305..61e0c5b 100644 --- a/contrib/session-helper/cd-main.c +++ b/contrib/session-helper/cd-main.c @@ -616,7 +616,7 @@ cd_main_calib_interpolate_up (CdMainPrivate *priv, gboolean ret = TRUE; gdouble mix; guint i; - _cleanup_ptrarray_unref_ GPtrArray *old_array; + _cleanup_ptrarray_unref_ GPtrArray *old_array = NULL; /* make a deep copy */ old_array = g_ptr_array_new_with_free_func (g_free); @@ -859,8 +859,8 @@ static gboolean cd_main_load_samples (CdMainPrivate *priv, GError **error) { const gchar *filename; - _cleanup_free_ gchar *path; - _cleanup_object_unref_ GFile *file; + _cleanup_free_ gchar *path = NULL; + _cleanup_object_unref_ GFile *file = NULL; filename = cd_main_get_display_ti1 (priv->quality); path = g_build_filename (DATADIR, @@ -939,7 +939,7 @@ cd_main_find_argyll_tool (const gchar *command, GError **error) { gboolean ret; - _cleanup_free_ gchar *filename; + _cleanup_free_ gchar *filename = NULL; /* try the original argyllcms filename installed in /usr/local/bin */ filename = g_strdup_printf ("/usr/local/bin/%s", command); @@ -976,9 +976,9 @@ static gboolean cd_main_import_profile (CdMainPrivate *priv, GError **error) { gboolean ret = TRUE; - _cleanup_free_ gchar *filename; - _cleanup_free_ gchar *path; - _cleanup_object_unref_ GFile *file; + _cleanup_free_ gchar *filename = NULL; + _cleanup_free_ gchar *path = NULL; + _cleanup_object_unref_ GFile *file = NULL; filename = g_strdup_printf ("%s.icc", priv->basename); path = g_build_filename (priv->working_path, @@ -1029,7 +1029,7 @@ cd_main_set_profile_metadata (CdMainPrivate *priv, GError **error) _cleanup_error_free_ GError *error_local = NULL; _cleanup_free_ gchar *profile_fn = NULL; _cleanup_free_ gchar *profile_path = NULL; - _cleanup_object_unref_ CdIcc *icc; + _cleanup_object_unref_ CdIcc *icc = NULL; _cleanup_object_unref_ GFile *file = NULL; /* get profile */ @@ -1108,7 +1108,7 @@ cd_main_generate_profile (CdMainPrivate *priv, GError **error) gboolean ret; gint exit_status = 0; _cleanup_free_ gchar *cmd_debug = NULL; - _cleanup_free_ gchar *command; + _cleanup_free_ gchar *command = NULL; _cleanup_free_ gchar *stderr_data = NULL; _cleanup_ptrarray_unref_ GPtrArray *array = NULL; @@ -1278,7 +1278,7 @@ cd_main_remove_temp_file (const gchar *filename, GCancellable *cancellable, GError **error) { - _cleanup_object_unref_ GFile *file; + _cleanup_object_unref_ GFile *file = NULL; g_debug ("removing %s", filename); file = g_file_new_for_path (filename); @@ -1294,7 +1294,7 @@ cd_main_remove_temp_files (CdMainPrivate *priv, GError **error) const gchar *filename; gboolean ret; gchar *src; - _cleanup_dir_close_ GDir *dir; + _cleanup_dir_close_ GDir *dir = NULL; /* try to open */ dir = g_dir_open (priv->working_path, 0, error); @@ -1465,7 +1465,7 @@ cd_main_find_device (CdMainPrivate *priv, { gboolean ret; _cleanup_error_free_ GError *error_local = NULL; - _cleanup_object_unref_ CdDevice *device_tmp; + _cleanup_object_unref_ CdDevice *device_tmp = NULL; device_tmp = cd_client_find_device_sync (priv->client, device_id, @@ -1515,7 +1515,7 @@ cd_main_find_sensor (CdMainPrivate *priv, { gboolean ret; _cleanup_error_free_ GError *error_local = NULL; - _cleanup_object_unref_ CdSensor *sensor_tmp; + _cleanup_object_unref_ CdSensor *sensor_tmp = NULL; sensor_tmp = cd_client_find_sensor_sync (priv->client, sensor_id, @@ -1923,7 +1923,7 @@ static GDBusNodeInfo * cd_main_load_introspection (const gchar *filename, GError **error) { _cleanup_free_ gchar *data = NULL; - _cleanup_object_unref_ GFile *file; + _cleanup_object_unref_ GFile *file = NULL; /* load file */ file = g_file_new_for_path (filename); diff --git a/lib/colord/cd-client.c b/lib/colord/cd-client.c index 10e5270..5fc4f73 100644 --- a/lib/colord/cd-client.c +++ b/lib/colord/cd-client.c @@ -1082,7 +1082,7 @@ cd_client_import_profile_query_info_cb (GObject *source_object, const gchar *type; _cleanup_error_free_ GError *error = NULL; _cleanup_free_ gchar *filename = NULL; - _cleanup_object_unref_ GFileInfo *info; + _cleanup_object_unref_ GFileInfo *info = NULL; /* get the file info */ filename = g_file_get_path (helper->dest); diff --git a/lib/colord/cd-icc-store.c b/lib/colord/cd-icc-store.c index 3be642e..c902a72 100644 --- a/lib/colord/cd-icc-store.c +++ b/lib/colord/cd-icc-store.c @@ -195,8 +195,8 @@ cd_icc_store_add_icc (CdIccStore *store, GFile *file, GError **error) { CdIccStorePrivate *priv = store->priv; _cleanup_bytes_unref_ GBytes *data = NULL; - _cleanup_free_ gchar *filename; - _cleanup_object_unref_ CdIcc *icc; + _cleanup_free_ gchar *filename = NULL; + _cleanup_object_unref_ CdIcc *icc = NULL; _cleanup_object_unref_ CdIcc *icc_tmp = NULL; /* use the GResource cache if available */ @@ -271,7 +271,7 @@ cd_icc_store_created_query_info_cb (GObject *source_object, gboolean ret; _cleanup_error_free_ GError *error = NULL; _cleanup_free_ gchar *path = NULL; - _cleanup_object_unref_ GFileInfo *info; + _cleanup_object_unref_ GFileInfo *info = NULL; _cleanup_object_unref_ GFile *parent = NULL; info = g_file_query_info_finish (file, res, NULL); diff --git a/lib/colord/cd-icc.c b/lib/colord/cd-icc.c index 477c086..1eedf9e 100644 --- a/lib/colord/cd-icc.c +++ b/lib/colord/cd-icc.c @@ -292,7 +292,7 @@ cd_icc_to_string (CdIcc *icc) /* date and time */ created = cd_icc_get_created (icc); if (created != NULL) { - _cleanup_free_ gchar *created_str; + _cleanup_free_ gchar *created_str = NULL; created_str = g_date_time_format (created, "%F, %T"); g_string_append_printf (str, " Date, Time\t= %s\n", created_str); g_date_time_unref (created); @@ -548,8 +548,8 @@ cd_icc_to_string (CdIcc *icc) for (entry = cmsDictGetEntryList (dict); entry != NULL; entry = cmsDictNextEntry (entry)) { - _cleanup_free_ gchar *ascii_name; - _cleanup_free_ gchar *ascii_value; + _cleanup_free_ gchar *ascii_name = NULL; + _cleanup_free_ gchar *ascii_value = NULL; /* convert from wchar_t to UTF-8 */ ascii_name = g_ucs4_to_utf8 ((gunichar *) entry->Name, -1, @@ -604,7 +604,7 @@ cd_icc_to_string (CdIcc *icc) continue; } for (j = 0; j < tmp; j++) { - _cleanup_string_free_ GString *string; + _cleanup_string_free_ GString *string = NULL; /* parse title */ string = g_string_new (""); @@ -1438,7 +1438,7 @@ cd_util_write_tag_localized (CdIcc *icc, const gchar *value; gboolean ret = TRUE; guint i; - _cleanup_list_free_ GList *keys; + _cleanup_list_free_ GList *keys = NULL; _cleanup_ptrarray_unref_ GPtrArray *array = NULL; /* convert all the hash entries into CdMluObject's */ diff --git a/lib/colord/cd-it8.c b/lib/colord/cd-it8.c index 269229d..aba59f2 100644 --- a/lib/colord/cd-it8.c +++ b/lib/colord/cd-it8.c @@ -1251,7 +1251,7 @@ cd_it8_save_to_file_cmf (CdIt8 *it8, cmsHANDLE it8_lcms, GError **error) /* set DATA_FORMAT (using an ID if there are more than one spectra */ spectrum = g_ptr_array_index (it8->priv->array_spectra, 0); for (i = 0; i < spectral_bands; i++) { - _cleanup_free_ gchar *label; + _cleanup_free_ gchar *label = NULL; label = g_strdup_printf ("SPEC_%.0f", cd_spectrum_get_wavelength (spectrum, i)); cmsIT8SetDataFormat (it8_lcms, i, label); @@ -1334,7 +1334,7 @@ cd_it8_save_to_file_ccss_sp (CdIt8 *it8, cmsHANDLE it8_lcms, GError **error) cmsIT8SetDataFormat (it8_lcms, 0, "SAMPLE_ID"); spectrum = g_ptr_array_index (it8->priv->array_spectra, 0); for (i = 0; i < spectral_bands; i++) { - _cleanup_free_ gchar *label; + _cleanup_free_ gchar *label = NULL; /* there are more spectral bands than integers between the * start and stop wavelengths */ if ((cd_spectrum_get_end (spectrum) - diff --git a/src/cd-common.c b/src/cd-common.c index d2165f8..ed63e76 100644 --- a/src/cd-common.c +++ b/src/cd-common.c @@ -74,7 +74,7 @@ cd_main_get_sender_uid (GDBusConnection *connection, GError **error) { guint uid = G_MAXUINT; - _cleanup_variant_unref_ GVariant *value; + _cleanup_variant_unref_ GVariant *value = NULL; /* call into DBus to get the user ID that issued the request */ value = g_dbus_connection_call_sync (connection, diff --git a/src/cd-main.c b/src/cd-main.c index 4f6e8c1..2579e6e 100644 --- a/src/cd-main.c +++ b/src/cd-main.c @@ -81,8 +81,8 @@ cd_main_profile_removed (CdMainPrivate *priv, CdProfile *profile) CdDevice *device_tmp; gboolean ret; guint i; - _cleanup_free_ gchar *object_path_tmp; - _cleanup_ptrarray_unref_ GPtrArray *devices; + _cleanup_free_ gchar *object_path_tmp = NULL; + _cleanup_ptrarray_unref_ GPtrArray *devices = NULL; /* remove from the array before emitting */ object_path_tmp = g_strdup (cd_profile_get_object_path (profile)); @@ -141,7 +141,7 @@ cd_main_device_removed (CdMainPrivate *priv, CdDevice *device) { GError *error = NULL; gboolean ret; - _cleanup_free_ gchar *object_path_tmp; + _cleanup_free_ gchar *object_path_tmp = NULL; /* remove from the array before emitting */ object_path_tmp = g_strdup (cd_device_get_object_path (device)); @@ -219,7 +219,7 @@ cd_main_create_profile (CdMainPrivate *priv, CdObjectScope scope, GError **error) { - _cleanup_object_unref_ CdProfile *profile_tmp; + _cleanup_object_unref_ CdProfile *profile_tmp = NULL; g_assert (priv->connection != NULL); @@ -374,7 +374,7 @@ cd_main_device_auto_add_from_md (CdMainPrivate *priv, { CdProfile *profile_tmp; guint i; - _cleanup_ptrarray_unref_ GPtrArray *array; + _cleanup_ptrarray_unref_ GPtrArray *array = NULL; /* get all the profiles, and check to see if any of them contain * MAPPING_device_id that matches the device */ @@ -400,7 +400,7 @@ cd_main_device_auto_add_from_db (CdMainPrivate *priv, CdDevice *device) guint64 timestamp; guint i; _cleanup_error_free_ GError *error = NULL; - _cleanup_ptrarray_unref_ GPtrArray *array; + _cleanup_ptrarray_unref_ GPtrArray *array = NULL; /* get data */ array = cd_mapping_db_get_profiles (priv->mapping_db, @@ -687,7 +687,7 @@ cd_main_profile_auto_add_from_db (CdMainPrivate *priv, { guint i; _cleanup_error_free_ GError *error = NULL; - _cleanup_ptrarray_unref_ GPtrArray *array; + _cleanup_ptrarray_unref_ GPtrArray *array = NULL; /* get data */ array = cd_mapping_db_get_devices (priv->mapping_db, @@ -813,7 +813,7 @@ cd_main_get_standard_space_metadata (CdMainPrivate *priv, guint i; guint score_best = 0; guint score_tmp; - _cleanup_ptrarray_unref_ GPtrArray *array; + _cleanup_ptrarray_unref_ GPtrArray *array = NULL; /* get all the profiles with this metadata */ array = cd_profile_array_get_by_metadata (priv->profiles_array, @@ -872,7 +872,7 @@ cd_main_get_cmdline_for_pid (guint pid) gsize len = 0; guint i; _cleanup_error_free_ GError *error = NULL; - _cleanup_free_ gchar *proc_path; + _cleanup_free_ gchar *proc_path = NULL; /* just read the link */ proc_path = g_strdup_printf ("/proc/%i/cmdline", pid); @@ -1684,7 +1684,7 @@ cd_main_icc_store_added_cb (CdIccStore *icc_store, gboolean ret; _cleanup_error_free_ GError *error = NULL; _cleanup_free_ gchar *profile_id = NULL; - _cleanup_object_unref_ CdProfile *profile; + _cleanup_object_unref_ CdProfile *profile = NULL; /* create profile */ profile = cd_profile_new (); @@ -1761,7 +1761,7 @@ cd_main_add_disk_device (CdMainPrivate *priv, const gchar *device_id) gboolean ret; guint i; _cleanup_error_free_ GError *error = NULL; - _cleanup_object_unref_ CdDevice *device; + _cleanup_object_unref_ CdDevice *device = NULL; _cleanup_ptrarray_unref_ GPtrArray *array_properties = NULL; device = cd_main_create_device (priv, @@ -1791,7 +1791,7 @@ cd_main_add_disk_device (CdMainPrivate *priv, const gchar *device_id) return; } for (i = 0; i < array_properties->len; i++) { - _cleanup_free_ gchar *value; + _cleanup_free_ gchar *value = NULL; property = g_ptr_array_index (array_properties, i); value = cd_device_db_get_property (priv->device_db, device_id, @@ -2089,8 +2089,8 @@ cd_main_timed_exit_cb (gpointer user_data) static GDBusNodeInfo * cd_main_load_introspection (const gchar *filename, GError **error) { - _cleanup_bytes_unref_ GBytes *data; - _cleanup_free_ gchar *path; + _cleanup_bytes_unref_ GBytes *data = NULL; + _cleanup_free_ gchar *path = NULL; /* lookup data */ path = g_build_filename ("/org/freedesktop/colord", filename, NULL); @@ -2232,9 +2232,9 @@ cd_main_load_plugins (CdMainPrivate *priv) { const gchar *filename_tmp; gboolean ret; - _cleanup_dir_close_ GDir *dir; + _cleanup_dir_close_ GDir *dir = NULL; _cleanup_error_free_ GError *error = NULL; - _cleanup_free_ gchar *path; + _cleanup_free_ gchar *path = NULL; /* search in the plugin directory for plugins */ path = g_build_filename (LIBDIR, "colord-plugins", NULL); @@ -2361,7 +2361,7 @@ cd_main_check_duplicate_edids (void) { const gchar *fn; gboolean use_xrandr_mode = FALSE; - _cleanup_dir_close_ GDir *dir; + _cleanup_dir_close_ GDir *dir = NULL; _cleanup_hashtable_unref_ GHashTable *hash = NULL; dir = g_dir_open ("/sys/class/drm", 0, NULL); @@ -2455,7 +2455,7 @@ cd_main_dmi_get_vendor (void) "/sys/class/dmi/id/chassis_vendor", "/sys/class/dmi/id/board_vendor", NULL}; - _cleanup_free_ gchar *tmp; + _cleanup_free_ gchar *tmp = NULL; /* get vendor name */ tmp = cd_main_dmi_get_from_filenames (sysfs_vendor); @@ -2474,7 +2474,7 @@ cd_main_dmi_get_model (void) "/sys/class/dmi/id/board_name", NULL}; gchar *model; - _cleanup_free_ gchar *tmp; + _cleanup_free_ gchar *tmp = NULL; /* thinkpad puts the common name in the version field, urgh */ tmp = cd_main_dmi_get_from_filename ("/sys/class/dmi/id/product_version"); diff --git a/src/cd-profile.c b/src/cd-profile.c index 9b50834..cbe7791 100644 --- a/src/cd-profile.c +++ b/src/cd-profile.c @@ -199,8 +199,8 @@ static void cd_profile_set_object_path (CdProfile *profile) { struct passwd *pw; - _cleanup_free_ gchar *path_tmp; - _cleanup_free_ gchar *path_owner; + _cleanup_free_ gchar *path_tmp = NULL; + _cleanup_free_ gchar *path_owner = NULL; /* append the uid to the object path */ pw = getpwuid (profile->priv->owner); diff --git a/src/cd-sensor.c b/src/cd-sensor.c index 61b4ee7..243a6e2 100644 --- a/src/cd-sensor.c +++ b/src/cd-sensor.c @@ -1283,7 +1283,7 @@ void cd_sensor_set_index (CdSensor *sensor, guint idx) { - _cleanup_free_ gchar *id; + _cleanup_free_ gchar *id = NULL; id = g_strdup_printf ("%s-%02i", cd_sensor_kind_to_string (sensor->priv->kind), idx); diff --git a/src/plugins/cd-plugin-camera.c b/src/plugins/cd-plugin-camera.c index 4efabee..1bc03ce 100644 --- a/src/plugins/cd-plugin-camera.c +++ b/src/plugins/cd-plugin-camera.c @@ -79,7 +79,7 @@ cd_plugin_is_device_embedded (GUdevDevice *device) const gchar *removable; gboolean embedded = FALSE; guint i; - _cleanup_ptrarray_unref_ GPtrArray *array; + _cleanup_ptrarray_unref_ GPtrArray *array = NULL; /* get a chain of all the parent devices */ array = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref); diff --git a/src/sensors/cd-sensor-colorhug.c b/src/sensors/cd-sensor-colorhug.c index 911d0ae..9925afd 100644 --- a/src/sensors/cd-sensor-colorhug.c +++ b/src/sensors/cd-sensor-colorhug.c @@ -538,7 +538,7 @@ cd_sensor_set_next_option (CdSensorAsyncState *state) gboolean ret; GVariant *value; _cleanup_error_free_ GError *error = NULL; - _cleanup_list_free_ GList *keys; + _cleanup_list_free_ GList *keys = NULL; /* write eeprom to preserve settings */ keys = g_hash_table_get_keys (state->options); |