diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2020-11-10 01:39:21 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2020-11-10 01:39:21 +0000 |
commit | 1954746989fe1d20dfefdcc2d3a2411ca12615ee (patch) | |
tree | 73dfb3bf50927f2209c943f105886ad699c90830 /gdk-pixbuf | |
parent | bb129a69f28030c8daf25c20fd408b0482f30baf (diff) | |
download | gdk-pixbuf-1954746989fe1d20dfefdcc2d3a2411ca12615ee.tar.gz |
io: Initialize variable before reading into it
We must handle the error path, where the out argument isn't set.
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-io.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c index 58bb74879..40eb920c8 100644 --- a/gdk-pixbuf/gdk-pixbuf-io.c +++ b/gdk-pixbuf/gdk-pixbuf-io.c @@ -396,7 +396,7 @@ gdk_pixbuf_io_init_modules (const char *filename, GString *tmp_buf = g_string_new (NULL); gboolean have_error = FALSE; GdkPixbufModule *module = NULL; - int flags; + int flags = 0; int n_patterns = 0; GdkPixbufModulePattern *pattern; GError *local_error = NULL; @@ -428,8 +428,7 @@ gdk_pixbuf_io_init_modules (const char *filename, line_buf[term] = 0; if (!skip_space (&p)) { - /* Blank line marking the end of a module - */ + /* Blank line marking the end of a module */ if (module && *p != '#') { file_formats = g_slist_prepend (file_formats, module); module = NULL; @@ -442,8 +441,7 @@ gdk_pixbuf_io_init_modules (const char *filename, goto next_line; if (!module) { - /* Read a module location - */ + /* Read a module location */ module = g_new0 (GdkPixbufModule, 1); n_patterns = 0; @@ -464,6 +462,7 @@ gdk_pixbuf_io_init_modules (const char *filename, module->info->name = g_strdup (tmp_buf->str); module->module_name = module->info->name; + flags = 0; if (!scan_int (&p, &flags)) { g_warning ("Error parsing loader info in '%s'\n %s", filename, line_buf); |