summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-11-04 16:30:23 +0000
committerRichard Hughes <richard@hughsie.com>2014-11-04 16:30:24 +0000
commitcaa4d69ddbc4a3fd4a570ac73b64ac36a34b4a02 (patch)
tree3ca7f5f7c251c78ccdb593cd25bec135569bd554
parent3b5399778818cc45ddefd9138a02b5ba2626a1d9 (diff)
downloadappstream-glib-caa4d69ddbc4a3fd4a570ac73b64ac36a34b4a02.tar.gz
trivial: Don't show warnings when doing distcheck
It seems that the compiler really does require an initializer when using the _cleanup_ macros.
-rw-r--r--client/as-util.c4
-rw-r--r--libappstream-builder/asb-app.c4
-rw-r--r--libappstream-builder/asb-context.c12
-rw-r--r--libappstream-builder/asb-package-alpm.c2
-rw-r--r--libappstream-builder/asb-package-rpm.c2
-rw-r--r--libappstream-builder/asb-package.c2
-rw-r--r--libappstream-builder/asb-plugin-loader.c4
-rw-r--r--libappstream-builder/asb-task.c6
-rw-r--r--libappstream-builder/asb-utils.c2
-rw-r--r--libappstream-builder/plugins/asb-plugin-appdata.c12
-rw-r--r--libappstream-builder/plugins/asb-plugin-desktop.c2
-rw-r--r--libappstream-builder/plugins/asb-plugin-font.c6
-rw-r--r--libappstream-builder/plugins/asb-plugin-gettext.c6
-rw-r--r--libappstream-builder/plugins/asb-plugin-gir.c2
-rw-r--r--libappstream-builder/plugins/asb-plugin-hardcoded.c2
-rw-r--r--libappstream-builder/plugins/asb-plugin-ibus-xml.c2
-rw-r--r--libappstream-builder/plugins/asb-plugin-metainfo.c2
-rw-r--r--libappstream-glib/as-app-validate.c4
-rw-r--r--libappstream-glib/as-app.c10
-rw-r--r--libappstream-glib/as-image.c2
-rw-r--r--libappstream-glib/as-release.c2
-rw-r--r--libappstream-glib/as-screenshot.c2
-rw-r--r--libappstream-glib/as-self-test.c22
-rw-r--r--libappstream-glib/as-store.c8
-rw-r--r--libappstream-glib/as-utils.c20
25 files changed, 71 insertions, 71 deletions
diff --git a/client/as-util.c b/client/as-util.c
index 97183a8..3c2b330 100644
--- a/client/as-util.c
+++ b/client/as-util.c
@@ -2045,8 +2045,8 @@ as_util_validate_file (const gchar *filename,
g_print ("%s: ", filename);
if (as_app_guess_source_kind (filename) == AS_APP_SOURCE_KIND_APPSTREAM) {
gboolean ret;
- _cleanup_object_unref_ AsStore *store;
- _cleanup_object_unref_ GFile *file;
+ _cleanup_object_unref_ AsStore *store = NULL;
+ _cleanup_object_unref_ GFile *file = NULL;
file = g_file_new_for_path (filename);
store = as_store_new ();
ret = as_store_from_file (store, file, NULL, NULL, error);
diff --git a/libappstream-builder/asb-app.c b/libappstream-builder/asb-app.c
index aed370c..5494bb8 100644
--- a/libappstream-builder/asb-app.c
+++ b/libappstream-builder/asb-app.c
@@ -181,7 +181,7 @@ asb_app_save_resources_image (AsbApp *app,
const gchar *output_dir;
gboolean ret = TRUE;
_cleanup_free_ gchar *filename = NULL;
- _cleanup_free_ gchar *size_str;
+ _cleanup_free_ gchar *size_str = NULL;
/* treat source images differently */
if (as_image_get_kind (image) == AS_IMAGE_KIND_SOURCE) {
@@ -402,7 +402,7 @@ asb_app_add_screenshot_source (AsbApp *app, const gchar *filename, GError **erro
_cleanup_free_ gchar *basename = NULL;
_cleanup_free_ gchar *filename_no_path = NULL;
_cleanup_free_ gchar *url_src = NULL;
- _cleanup_object_unref_ AsImage *im_src;
+ _cleanup_object_unref_ AsImage *im_src = NULL;
_cleanup_object_unref_ AsScreenshot *ss = NULL;
guint sizes[] = { AS_IMAGE_NORMAL_WIDTH, AS_IMAGE_NORMAL_HEIGHT,
AS_IMAGE_THUMBNAIL_WIDTH, AS_IMAGE_THUMBNAIL_HEIGHT,
diff --git a/libappstream-builder/asb-context.c b/libappstream-builder/asb-context.c
index 12498cf..00f3883 100644
--- a/libappstream-builder/asb-context.c
+++ b/libappstream-builder/asb-context.c
@@ -765,7 +765,7 @@ asb_context_setup (AsbContext *ctx, GError **error)
if (!asb_utils_ensure_exists (ss_src, error))
return FALSE;
for (i = 0; sizes[i] != 0; i += 2) {
- _cleanup_free_ gchar *size_str;
+ _cleanup_free_ gchar *size_str = NULL;
_cleanup_free_ gchar *ss_dir = NULL;
size_str = g_strdup_printf ("%ix%i",
sizes[i],
@@ -776,7 +776,7 @@ asb_context_setup (AsbContext *ctx, GError **error)
return FALSE;
}
for (i = 0; sizes[i] != 0 && priv->hidpi_enabled; i += 2) {
- _cleanup_free_ gchar *size_str;
+ _cleanup_free_ gchar *size_str = NULL;
_cleanup_free_ gchar *ss_dir = NULL;
size_str = g_strdup_printf ("%ix%i",
sizes[i] * 2,
@@ -940,8 +940,8 @@ asb_context_write_xml (AsbContext *ctx,
AsbContextPrivate *priv = GET_PRIVATE (ctx);
GList *l;
_cleanup_free_ gchar *filename = NULL;
- _cleanup_object_unref_ AsStore *store;
- _cleanup_object_unref_ GFile *file;
+ _cleanup_object_unref_ AsStore *store = NULL;
+ _cleanup_object_unref_ GFile *file = NULL;
/* convert any vetod applications into dummy components */
for (l = priv->apps; l != NULL; l = l->next) {
@@ -1199,7 +1199,7 @@ asb_context_write_xml_fail (AsbContext *ctx,
GList *l;
_cleanup_free_ gchar *basename_failed = NULL;
_cleanup_free_ gchar *filename = NULL;
- _cleanup_object_unref_ GFile *file;
+ _cleanup_object_unref_ GFile *file = NULL;
for (l = priv->apps; l != NULL; l = l->next) {
app = AS_APP (l->data);
@@ -1282,7 +1282,7 @@ asb_context_disable_older_pkgs (AsbContext *ctx)
AsbPackage *pkg;
const gchar *key;
guint i;
- _cleanup_hashtable_unref_ GHashTable *newest;
+ _cleanup_hashtable_unref_ GHashTable *newest = NULL;
newest = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, (GDestroyNotify) g_object_unref);
diff --git a/libappstream-builder/asb-package-alpm.c b/libappstream-builder/asb-package-alpm.c
index b19b6ab..a8469a7 100644
--- a/libappstream-builder/asb-package-alpm.c
+++ b/libappstream-builder/asb-package-alpm.c
@@ -161,7 +161,7 @@ asb_package_alpm_ensure_depends (AsbPackage *pkg, GError **error)
AsbPackageAlpmPrivate *priv = GET_PRIVATE (pkg_alpm);
alpm_list_t *alpm_depends;
- GPtrArray _cleanup_ptrarray_unref_ *depends;
+ GPtrArray _cleanup_ptrarray_unref_ *depends = NULL;
alpm_depends = alpm_pkg_get_depends (priv->package);
depends = asb_package_alpm_list_to_array (alpm_depends);
diff --git a/libappstream-builder/asb-package-rpm.c b/libappstream-builder/asb-package-rpm.c
index 3ddfafa..3317850 100644
--- a/libappstream-builder/asb-package-rpm.c
+++ b/libappstream-builder/asb-package-rpm.c
@@ -312,9 +312,9 @@ asb_package_rpm_add_release (AsbPackage *pkg,
{
AsRelease *release;
const gchar *version;
- _cleanup_free_ gchar *name_dup;
gchar *tmp;
gchar *vr;
+ _cleanup_free_ gchar *name_dup = NULL;
/* get last string chunk */
name_dup = g_strchomp (g_strdup (name));
diff --git a/libappstream-builder/asb-package.c b/libappstream-builder/asb-package.c
index 2c63693..989de43 100644
--- a/libappstream-builder/asb-package.c
+++ b/libappstream-builder/asb-package.c
@@ -188,7 +188,7 @@ asb_package_log (AsbPackage *pkg,
AsbPackagePrivate *priv = GET_PRIVATE (pkg);
va_list args;
gdouble now;
- _cleanup_free_ gchar *tmp;
+ _cleanup_free_ gchar *tmp = NULL;
g_mutex_lock (&priv->mutex_log);
diff --git a/libappstream-builder/asb-plugin-loader.c b/libappstream-builder/asb-plugin-loader.c
index 9ff4b2c..7e070dc 100644
--- a/libappstream-builder/asb-plugin-loader.c
+++ b/libappstream-builder/asb-plugin-loader.c
@@ -263,7 +263,7 @@ asb_plugin_loader_merge (AsbPluginLoader *plugin_loader, GList *apps)
const gchar *tmp;
gboolean ret;
guint i;
- _cleanup_hashtable_unref_ GHashTable *hash;
+ _cleanup_hashtable_unref_ GHashTable *hash = NULL;
/* run each plugin */
for (i = 0; i < priv->plugins->len; i++) {
@@ -386,7 +386,7 @@ asb_plugin_loader_setup (AsbPluginLoader *plugin_loader, GError **error)
AsbPluginLoaderPrivate *priv = GET_PRIVATE (plugin_loader);
const gchar *filename_tmp;
const gchar *location = "./plugins/.libs/";
- _cleanup_dir_close_ GDir *dir;
+ _cleanup_dir_close_ GDir *dir = NULL;
/* search system-wide if not found locally */
if (!g_file_test (location, G_FILE_TEST_EXISTS))
diff --git a/libappstream-builder/asb-task.c b/libappstream-builder/asb-task.c
index 6653370..e613cf7 100644
--- a/libappstream-builder/asb-task.c
+++ b/libappstream-builder/asb-task.c
@@ -141,9 +141,9 @@ asb_task_explode_extra_packages (AsbTask *task, GError **error)
const gchar *tmp;
gchar **deps;
guint i;
- _cleanup_hashtable_unref_ GHashTable *hash;
- _cleanup_ptrarray_unref_ GPtrArray *array;
- _cleanup_ptrarray_unref_ GPtrArray *icon_themes;
+ _cleanup_hashtable_unref_ GHashTable *hash = NULL;
+ _cleanup_ptrarray_unref_ GPtrArray *array = NULL;
+ _cleanup_ptrarray_unref_ GPtrArray *icon_themes = NULL;
/* anything the package requires */
hash = g_hash_table_new (g_str_hash, g_str_equal);
diff --git a/libappstream-builder/asb-utils.c b/libappstream-builder/asb-utils.c
index 6d2fbb6..8fb1078 100644
--- a/libappstream-builder/asb-utils.c
+++ b/libappstream-builder/asb-utils.c
@@ -157,7 +157,7 @@ asb_utils_ensure_exists_and_empty (const gchar *directory, GError **error)
/* find each */
while ((filename = g_dir_read_name (dir))) {
- _cleanup_free_ gchar *src;
+ _cleanup_free_ gchar *src = NULL;
src = g_build_filename (directory, filename, NULL);
if (g_file_test (src, G_FILE_TEST_IS_DIR)) {
if (!asb_utils_rmtree (src, error))
diff --git a/libappstream-builder/plugins/asb-plugin-appdata.c b/libappstream-builder/plugins/asb-plugin-appdata.c
index 3d1887a..f134fce 100644
--- a/libappstream-builder/plugins/asb-plugin-appdata.c
+++ b/libappstream-builder/plugins/asb-plugin-appdata.c
@@ -101,7 +101,7 @@ asb_plugin_appdata_add_path (AsbPlugin *plugin, const gchar *path, GError **erro
if (dir == NULL)
return FALSE;
while ((tmp = g_dir_read_name (dir)) != NULL) {
- _cleanup_free_ gchar *filename;
+ _cleanup_free_ gchar *filename = NULL;
filename = g_build_filename (path, tmp, NULL);
if (g_file_test (filename, G_FILE_TEST_IS_DIR)) {
if (!asb_plugin_appdata_add_path (plugin, filename, error))
@@ -187,8 +187,8 @@ asb_plugin_appdata_load_url (AsbPlugin *plugin,
gboolean ret = TRUE;
SoupStatus status;
SoupURI *uri = NULL;
- _cleanup_free_ gchar *basename;
- _cleanup_free_ gchar *cache_filename;
+ _cleanup_free_ gchar *basename = NULL;
+ _cleanup_free_ gchar *cache_filename = NULL;
_cleanup_object_unref_ SoupMessage *msg = NULL;
/* download to cache if not already added */
@@ -268,7 +268,7 @@ asb_plugin_process_filename (AsbPlugin *plugin,
GList *l;
GList *list;
guint i;
- _cleanup_object_unref_ AsApp *appdata;
+ _cleanup_object_unref_ AsApp *appdata = NULL;
_cleanup_ptrarray_unref_ GPtrArray *problems = NULL;
/* validate */
@@ -504,8 +504,8 @@ asb_plugin_process_app (AsbPlugin *plugin,
{
const gchar *kind_str;
const gchar *tmp;
- _cleanup_free_ gchar *appdata_basename;
- _cleanup_free_ gchar *appdata_filename;
+ _cleanup_free_ gchar *appdata_basename = NULL;
+ _cleanup_free_ gchar *appdata_filename = NULL;
_cleanup_free_ gchar *appdata_filename_extra = NULL;
/* get possible sources */
diff --git a/libappstream-builder/plugins/asb-plugin-desktop.c b/libappstream-builder/plugins/asb-plugin-desktop.c
index 9152dcd..bde3ce0 100644
--- a/libappstream-builder/plugins/asb-plugin-desktop.c
+++ b/libappstream-builder/plugins/asb-plugin-desktop.c
@@ -343,7 +343,7 @@ asb_plugin_process_filename (AsbPlugin *plugin,
/* is the icon a stock-icon-name? */
icon = as_app_get_icon_default (AS_APP (app));
if (icon != NULL) {
- _cleanup_free_ gchar *key;
+ _cleanup_free_ gchar *key = NULL;
key = g_strdup (as_icon_get_name (icon));
if (as_icon_get_kind (icon) == AS_ICON_KIND_STOCK) {
asb_package_log (pkg,
diff --git a/libappstream-builder/plugins/asb-plugin-font.c b/libappstream-builder/plugins/asb-plugin-font.c
index fa5404f..d47695f 100644
--- a/libappstream-builder/plugins/asb-plugin-font.c
+++ b/libappstream-builder/plugins/asb-plugin-font.c
@@ -185,7 +185,7 @@ asb_font_fix_metadata (AsbApp *app)
"FontIconText",
"Aa", -1);
} else {
- _cleanup_free_ gchar *icon_tmp;
+ _cleanup_free_ gchar *icon_tmp = NULL;
icon_tmp = g_utf8_substring (value, 0, 2);
as_app_add_metadata (AS_APP (app),
"FontIconText",
@@ -523,7 +523,6 @@ asb_plugin_font_set_name (AsbApp *app, const gchar *name)
const gchar *ptr;
guint i;
guint len;
- _cleanup_free_ gchar *tmp;
const gchar *prefixes[] = { "GFS ", NULL };
const gchar *suffixes[] = { " SIL",
" ADF",
@@ -531,6 +530,7 @@ asb_plugin_font_set_name (AsbApp *app, const gchar *name)
" GPL&GNU",
" SC",
NULL };
+ _cleanup_free_ gchar *tmp = NULL;
/* remove font foundary suffix */
tmp = g_strdup (name);
@@ -710,7 +710,7 @@ asb_plugin_merge (AsbPlugin *plugin, GList *list)
GList *l;
GPtrArray *extends_tmp;
const gchar *tmp;
- _cleanup_hashtable_unref_ GHashTable *hash;
+ _cleanup_hashtable_unref_ GHashTable *hash = NULL;
/* add all the fonts to a hash */
hash = g_hash_table_new_full (g_str_hash, g_str_equal,
diff --git a/libappstream-builder/plugins/asb-plugin-gettext.c b/libappstream-builder/plugins/asb-plugin-gettext.c
index 0fd84d0..4a1d671 100644
--- a/libappstream-builder/plugins/asb-plugin-gettext.c
+++ b/libappstream-builder/plugins/asb-plugin-gettext.c
@@ -150,7 +150,7 @@ asb_gettext_ctx_search_locale (AsbGettextContext *ctx,
{
const gchar *filename;
guint i;
- _cleanup_dir_close_ GDir *dir;
+ _cleanup_dir_close_ GDir *dir = NULL;
_cleanup_ptrarray_unref_ GPtrArray *mo_paths = NULL;
dir = g_dir_open (messages_path, 0, error);
@@ -160,7 +160,7 @@ asb_gettext_ctx_search_locale (AsbGettextContext *ctx,
/* do a first pass at this, trying to find the prefered .mo */
mo_paths = g_ptr_array_new_with_free_func (g_free);
while ((filename = g_dir_read_name (dir)) != NULL) {
- _cleanup_free_ gchar *path;
+ _cleanup_free_ gchar *path = NULL;
path = g_build_filename (messages_path, filename, NULL);
if (!g_file_test (path, G_FILE_TEST_EXISTS))
continue;
@@ -211,7 +211,7 @@ asb_gettext_ctx_search_path (AsbGettextContext *ctx,
if (dir == NULL)
return FALSE;
while ((filename = g_dir_read_name (dir)) != NULL) {
- _cleanup_free_ gchar *path;
+ _cleanup_free_ gchar *path = NULL;
path = g_build_filename (root, filename, "LC_MESSAGES", NULL);
if (g_file_test (path, G_FILE_TEST_EXISTS)) {
if (!asb_gettext_ctx_search_locale (ctx, filename, path, error))
diff --git a/libappstream-builder/plugins/asb-plugin-gir.c b/libappstream-builder/plugins/asb-plugin-gir.c
index 4a96893..6217b9e 100644
--- a/libappstream-builder/plugins/asb-plugin-gir.c
+++ b/libappstream-builder/plugins/asb-plugin-gir.c
@@ -67,7 +67,7 @@ asb_plugin_process_gir (AsbApp *app,
const gchar *name;
const gchar *version;
gboolean ret = TRUE;
- _cleanup_free_ gchar *filename_full;
+ _cleanup_free_ gchar *filename_full = NULL;
_cleanup_object_unref_ GFile *file = NULL;
/* load file */
diff --git a/libappstream-builder/plugins/asb-plugin-hardcoded.c b/libappstream-builder/plugins/asb-plugin-hardcoded.c
index 59c1044..c955abe 100644
--- a/libappstream-builder/plugins/asb-plugin-hardcoded.c
+++ b/libappstream-builder/plugins/asb-plugin-hardcoded.c
@@ -108,7 +108,7 @@ asb_plugin_hardcoded_add_screenshots (AsbApp *app,
gboolean ret = TRUE;
GList *l;
GList *list = NULL;
- _cleanup_dir_close_ GDir *dir;
+ _cleanup_dir_close_ GDir *dir = NULL;
/* scan for files */
dir = g_dir_open (location, 0, error);
diff --git a/libappstream-builder/plugins/asb-plugin-ibus-xml.c b/libappstream-builder/plugins/asb-plugin-ibus-xml.c
index a450cec..2d47807 100644
--- a/libappstream-builder/plugins/asb-plugin-ibus-xml.c
+++ b/libappstream-builder/plugins/asb-plugin-ibus-xml.c
@@ -84,7 +84,7 @@ asb_plugin_process_filename (AsbPlugin *plugin,
guint i;
_cleanup_free_ gchar *basename = NULL;
_cleanup_free_ gchar *data = NULL;
- _cleanup_free_ gchar *filename_tmp;
+ _cleanup_free_ gchar *filename_tmp = NULL;
_cleanup_object_unref_ AsbApp *app = NULL;
_cleanup_object_unref_ AsIcon *icon = NULL;
_cleanup_strv_free_ gchar **languages = NULL;
diff --git a/libappstream-builder/plugins/asb-plugin-metainfo.c b/libappstream-builder/plugins/asb-plugin-metainfo.c
index c78a8f4..490d5ae 100644
--- a/libappstream-builder/plugins/asb-plugin-metainfo.c
+++ b/libappstream-builder/plugins/asb-plugin-metainfo.c
@@ -146,7 +146,7 @@ asb_plugin_merge (AsbPlugin *plugin, GList *list)
AsApp *app;
AsApp *found;
GList *l;
- _cleanup_hashtable_unref_ GHashTable *hash;
+ _cleanup_hashtable_unref_ GHashTable *hash = NULL;
/* make a hash table of ID->AsApp */
hash = g_hash_table_new_full (g_str_hash, g_str_equal,
diff --git a/libappstream-glib/as-app-validate.c b/libappstream-glib/as-app-validate.c
index 1a82538..1d6fb00 100644
--- a/libappstream-glib/as-app-validate.c
+++ b/libappstream-glib/as-app-validate.c
@@ -54,7 +54,7 @@ ai_app_validate_add (GPtrArray *problems,
AsProblem *problem;
guint i;
va_list args;
- _cleanup_free_ gchar *str;
+ _cleanup_free_ gchar *str = NULL;
va_start (args, fmt);
str = g_strdup_vprintf (fmt, args);
@@ -327,7 +327,7 @@ as_app_validate_description (const gchar *xml,
{
GNode *l;
GNode *l2;
- _cleanup_node_unref_ GNode *node;
+ _cleanup_node_unref_ GNode *node = NULL;
/* parse xml */
node = as_node_from_xml (xml, -1,
diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c
index f4f7c96..0b6d5aa 100644
--- a/libappstream-glib/as-app.c
+++ b/libappstream-glib/as-app.c
@@ -2364,7 +2364,7 @@ as_app_subsume_dict (GHashTable *dest, GHashTable *src, gboolean overwrite)
const gchar *tmp;
const gchar *key;
const gchar *value;
- _cleanup_list_free_ GList *keys;
+ _cleanup_list_free_ GList *keys = NULL;
keys = g_hash_table_get_keys (src);
for (l = keys; l != NULL; l = l->next) {
@@ -2662,7 +2662,7 @@ as_app_node_insert_languages (AsApp *app, GNode *parent)
const gchar *locale;
gchar tmp[4];
gint percentage;
- _cleanup_list_free_ GList *langs;
+ _cleanup_list_free_ GList *langs = NULL;
node_tmp = as_node_insert (parent, "languages", NULL, 0, NULL);
langs = as_app_get_languages (app);
@@ -3114,7 +3114,7 @@ as_app_node_parse_child (AsApp *app, GNode *n, AsAppParseFlags flags, GError **e
/* unwrap appdata inline */
if (priv->source_kind == AS_APP_SOURCE_KIND_APPDATA) {
GError *error_local = NULL;
- _cleanup_hashtable_unref_ GHashTable *unwrapped;
+ _cleanup_hashtable_unref_ GHashTable *unwrapped = NULL;
unwrapped = as_node_get_localized_unwrap (n, &error_local);
if (unwrapped == NULL) {
if (g_error_matches (error_local,
@@ -3144,7 +3144,7 @@ as_app_node_parse_child (AsApp *app, GNode *n, AsAppParseFlags flags, GError **e
as_node_get_data (n),
-1);
} else {
- _cleanup_string_free_ GString *xml;
+ _cleanup_string_free_ GString *xml = NULL;
xml = as_node_to_xml (n->children,
AS_NODE_TO_XML_FLAG_INCLUDE_SIBLINGS);
as_app_set_description (app,
@@ -3349,7 +3349,7 @@ as_app_node_parse_child (AsApp *app, GNode *n, AsAppParseFlags flags, GError **e
if (!(flags & AS_APP_PARSE_FLAG_APPEND_DATA))
g_ptr_array_set_size (priv->provides, 0);
for (c = n->children; c != NULL; c = c->next) {
- _cleanup_object_unref_ AsProvide *p;
+ _cleanup_object_unref_ AsProvide *p = NULL;
p = as_provide_new ();
if (!as_provide_node_parse (p, c, error))
return FALSE;
diff --git a/libappstream-glib/as-image.c b/libappstream-glib/as-image.c
index bfc8636..d8e4880 100644
--- a/libappstream-glib/as-image.c
+++ b/libappstream-glib/as-image.c
@@ -641,7 +641,7 @@ as_image_save_filename (AsImage *image,
AsImageSaveFlags flags,
GError **error)
{
- _cleanup_object_unref_ GdkPixbuf *pixbuf;
+ _cleanup_object_unref_ GdkPixbuf *pixbuf = NULL;
/* save source file */
pixbuf = as_image_save_pixbuf (image, width, height, flags);
diff --git a/libappstream-glib/as-release.c b/libappstream-glib/as-release.c
index a9d4df7..f9bfcb1 100644
--- a/libappstream-glib/as-release.c
+++ b/libappstream-glib/as-release.c
@@ -228,7 +228,7 @@ as_release_node_insert (AsRelease *release, GNode *parent, gdouble api_version)
{
AsReleasePrivate *priv = GET_PRIVATE (release);
GNode *n;
- _cleanup_free_ gchar *timestamp_str;
+ _cleanup_free_ gchar *timestamp_str = NULL;
timestamp_str = g_strdup_printf ("%" G_GUINT64_FORMAT,
priv->timestamp);
diff --git a/libappstream-glib/as-screenshot.c b/libappstream-glib/as-screenshot.c
index 84ede21..c2ac8b2 100644
--- a/libappstream-glib/as-screenshot.c
+++ b/libappstream-glib/as-screenshot.c
@@ -418,7 +418,7 @@ as_screenshot_node_parse (AsScreenshot *screenshot, GNode *node, GError **error)
/* add captions */
captions = as_node_get_localized (node, "caption");
if (captions != NULL) {
- _cleanup_list_free_ GList *keys;
+ _cleanup_list_free_ GList *keys = NULL;
keys = g_hash_table_get_keys (captions);
for (l = keys; l != NULL; l = l->next) {
tmp = l->data;
diff --git a/libappstream-glib/as-self-test.c b/libappstream-glib/as-self-test.c
index 162733f..860411c 100644
--- a/libappstream-glib/as-self-test.c
+++ b/libappstream-glib/as-self-test.c
@@ -165,7 +165,7 @@ as_test_release_desc_func (void)
"<description><p>This is a new release</p></description>"
"<description xml:lang=\"pl\"><p>Oprogramowanie</p></description>"
"</release>";
- _cleanup_object_unref_ AsRelease *release;
+ _cleanup_object_unref_ AsRelease *release = NULL;
release = as_release_new ();
@@ -291,7 +291,7 @@ as_test_image_alpha_func (void)
_cleanup_free_ gchar *fn_internal2 = NULL;
_cleanup_free_ gchar *fn_none = NULL;
_cleanup_free_ gchar *fn_vert = NULL;
- _cleanup_object_unref_ AsImage *im;
+ _cleanup_object_unref_ AsImage *im = NULL;
/* horiz */
fn_horiz = as_test_get_filename ("alpha-horiz.png");
@@ -1406,7 +1406,7 @@ as_test_node_sort_func (void)
{
_cleanup_error_free_ GError *error = NULL;
_cleanup_node_unref_ GNode *root = NULL;
- _cleanup_string_free_ GString *str;
+ _cleanup_string_free_ GString *str = NULL;
root = as_node_from_xml ("<d>ddd</d><c>ccc</c><b>bbb</b><a>aaa</a>", -1, 0, &error);
g_assert_no_error (error);
@@ -1712,8 +1712,8 @@ static void
as_test_node_intltool_func (void)
{
GNode *n;
- _cleanup_node_unref_ GNode *root;
- _cleanup_string_free_ GString *str;
+ _cleanup_node_unref_ GNode *root = NULL;
+ _cleanup_string_free_ GString *str = NULL;
root = as_node_new ();
n = as_node_insert (root, "description", NULL, AS_NODE_INSERT_FLAG_NONE, NULL);
@@ -2299,8 +2299,8 @@ as_test_store_addons_func (void)
"<id>eclipse.desktop</id>"
"</component>"
"</components>";
- _cleanup_object_unref_ AsStore *store;
- _cleanup_string_free_ GString *str;
+ _cleanup_object_unref_ AsStore *store = NULL;
+ _cleanup_string_free_ GString *str = NULL;
/* load a file to the store */
store = as_store_new ();
@@ -2423,7 +2423,7 @@ as_test_store_speed_appstream_func (void)
file = g_file_new_for_path (filename);
timer = g_timer_new ();
for (i = 0; i < loops; i++) {
- _cleanup_object_unref_ AsStore *store;
+ _cleanup_object_unref_ AsStore *store = NULL;
store = as_store_new ();
ret = as_store_from_file (store, file, NULL, NULL, &error);
g_assert_no_error (error);
@@ -2448,7 +2448,7 @@ as_test_store_speed_appdata_func (void)
filename = as_test_get_filename (".");
timer = g_timer_new ();
for (i = 0; i < loops; i++) {
- _cleanup_object_unref_ AsStore *store;
+ _cleanup_object_unref_ AsStore *store = NULL;
store = as_store_new ();
as_store_set_destdir (store, filename);
g_test_expect_message (G_LOG_DOMAIN,
@@ -2475,7 +2475,7 @@ as_test_store_speed_desktop_func (void)
filename = as_test_get_filename (".");
timer = g_timer_new ();
for (i = 0; i < loops; i++) {
- _cleanup_object_unref_ AsStore *store;
+ _cleanup_object_unref_ AsStore *store = NULL;
store = as_store_new ();
as_store_set_destdir (store, filename);
ret = as_store_load (store, AS_STORE_LOAD_FLAG_DESKTOP, NULL, &error);
@@ -3029,7 +3029,7 @@ as_test_store_speed_yaml_func (void)
file = g_file_new_for_path (filename);
timer = g_timer_new ();
for (i = 0; i < loops; i++) {
- _cleanup_object_unref_ AsStore *store;
+ _cleanup_object_unref_ AsStore *store = NULL;
store = as_store_new ();
ret = as_store_from_file (store, file, NULL, NULL, &error);
g_assert_no_error (error);
diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c
index a109e0b..c130ddb 100644
--- a/libappstream-glib/as-store.c
+++ b/libappstream-glib/as-store.c
@@ -1181,7 +1181,7 @@ as_store_guess_origin_fallback (AsStore *store,
GError **error)
{
gchar *tmp;
- _cleanup_free_ gchar *origin_fallback;
+ _cleanup_free_ gchar *origin_fallback = NULL;
/* the first component of the file (e.g. "fedora-20.xml.gz)
* is used for the icon directory as we might want to clean up
@@ -1311,7 +1311,7 @@ as_store_load_app_info (AsStore *store,
}
icon_root = g_build_filename (path, "icons", NULL);
while ((tmp = g_dir_read_name (dir)) != NULL) {
- _cleanup_free_ gchar *filename_md;
+ _cleanup_free_ gchar *filename_md = NULL;
filename_md = g_build_filename (path_md, tmp, NULL);
if (!as_store_load_app_info_file (store,
filename_md,
@@ -1375,7 +1375,7 @@ as_store_load_app_install_file (AsStore *store,
GPtrArray *icons;
guint i;
_cleanup_error_free_ GError *error_local = NULL;
- _cleanup_object_unref_ AsApp *app;
+ _cleanup_object_unref_ AsApp *app = NULL;
app = as_app_new ();
as_app_set_icon_path (app, path_icons, -1);
@@ -1660,7 +1660,7 @@ as_store_validate_add (GPtrArray *problems, AsProblemKind kind, const gchar *fmt
AsProblem *problem;
guint i;
va_list args;
- _cleanup_free_ gchar *str;
+ _cleanup_free_ gchar *str = NULL;
va_start (args, fmt);
str = g_strdup_vprintf (fmt, args);
diff --git a/libappstream-glib/as-utils.c b/libappstream-glib/as-utils.c
index 4b1cde0..4020be5 100644
--- a/libappstream-glib/as-utils.c
+++ b/libappstream-glib/as-utils.c
@@ -196,7 +196,7 @@ as_hash_lookup_by_locale (GHashTable *hash, const gchar *locale)
gboolean
as_utils_is_stock_icon_name (const gchar *name)
{
- _cleanup_bytes_unref_ GBytes *data;
+ _cleanup_bytes_unref_ GBytes *data = NULL;
_cleanup_free_ gchar *key = NULL;
/* load the readonly data section and look for the icon name */
@@ -223,7 +223,7 @@ as_utils_is_stock_icon_name (const gchar *name)
gboolean
as_utils_is_spdx_license_id (const gchar *license_id)
{
- _cleanup_bytes_unref_ GBytes *data;
+ _cleanup_bytes_unref_ GBytes *data = NULL;
_cleanup_free_ gchar *key = NULL;
/* load the readonly data section and look for the icon name */
@@ -250,10 +250,10 @@ as_utils_is_spdx_license_id (const gchar *license_id)
gboolean
as_utils_is_blacklisted_id (const gchar *desktop_id)
{
- _cleanup_bytes_unref_ GBytes *data;
+ guint i;
+ _cleanup_bytes_unref_ GBytes *data = NULL;
_cleanup_free_ gchar *key = NULL;
_cleanup_strv_free_ gchar **split = NULL;
- guint i;
/* load the readonly data section and look for the icon name */
data = g_resource_lookup_data (as_get_resource (),
@@ -283,7 +283,7 @@ as_utils_is_blacklisted_id (const gchar *desktop_id)
gboolean
as_utils_is_environment_id (const gchar *environment_id)
{
- _cleanup_bytes_unref_ GBytes *data;
+ _cleanup_bytes_unref_ GBytes *data = NULL;
_cleanup_free_ gchar *key = NULL;
/* load the readonly data section and look for the icon name */
@@ -310,7 +310,7 @@ as_utils_is_environment_id (const gchar *environment_id)
gboolean
as_utils_is_category_id (const gchar *category_id)
{
- _cleanup_bytes_unref_ GBytes *data;
+ _cleanup_bytes_unref_ GBytes *data = NULL;
_cleanup_free_ gchar *key = NULL;
/* load the readonly data section and look for the icon name */
@@ -722,7 +722,7 @@ as_pixbuf_blur (GdkPixbuf *src, gint radius, gint iterations)
{
gint kernel_size;
gint i;
- _cleanup_free_ guchar *div_kernel_size;
+ _cleanup_free_ guchar *div_kernel_size = NULL;
_cleanup_object_unref_ GdkPixbuf *tmp = NULL;
tmp = gdk_pixbuf_new (gdk_pixbuf_get_colorspace (src),
@@ -863,7 +863,7 @@ as_utils_find_icon_filename_full (const gchar *destdir,
/* is this an absolute path */
if (search[0] == '/') {
- _cleanup_free_ gchar *tmp;
+ _cleanup_free_ gchar *tmp = NULL;
tmp = g_build_filename (destdir, search, NULL);
if (!g_file_test (tmp, G_FILE_TEST_EXISTS)) {
g_set_error (error,
@@ -882,7 +882,7 @@ as_utils_find_icon_filename_full (const gchar *destdir,
for (i = 0; sizes[i] != NULL; i++) {
for (m = 0; types[m] != NULL; m++) {
for (j = 0; supported_ext[j] != NULL; j++) {
- _cleanup_free_ gchar *tmp;
+ _cleanup_free_ gchar *tmp = NULL;
tmp = g_strdup_printf ("%s/usr/share/icons/"
"%s/%s/%s/%s%s",
destdir,
@@ -901,7 +901,7 @@ as_utils_find_icon_filename_full (const gchar *destdir,
/* pixmap */
for (i = 0; pixmap_dirs[i] != NULL; i++) {
for (j = 0; supported_ext[j] != NULL; j++) {
- _cleanup_free_ gchar *tmp;
+ _cleanup_free_ gchar *tmp = NULL;
tmp = g_strdup_printf ("%s/usr/share/%s/%s%s",
destdir,
pixmap_dirs[i],