[file-roller] cfile: avoid compiler warning
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller] cfile: avoid compiler warning
- Date: Fri, 27 Sep 2013 17:06:47 +0000 (UTC)
commit f5d006acbeb75141053cab92c1d2a2d4d59b9625
Author: Aleksander Morgado <aleksander lanedo com>
Date: Thu Sep 26 16:00:54 2013 +0200
cfile: avoid compiler warning
If mime type is unhandled, warning and return. Otherwise 'compressed_filename'
will be used even if uninitialized:
fr-command-cfile.c: In function ‘fr_command_cfile_add’:
fr-command-cfile.c:311:9: warning: ‘compressed_filename’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
g_free (compressed_filename);
^
https://bugzilla.gnome.org/show_bug.cgi?id=708839
src/fr-command-cfile.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/fr-command-cfile.c b/src/fr-command-cfile.c
index 9965ee4..6b15768 100644
--- a/src/fr-command-cfile.c
+++ b/src/fr-command-cfile.c
@@ -287,6 +287,12 @@ fr_command_cfile_add (FrCommand *comm,
fr_process_add_arg (comm->process, filename);
fr_process_end_command (comm->process);
compressed_filename = g_strconcat (filename, ".rz", NULL);
+ } else {
+ g_warning ("Unhandled mime type: '%s'", archive->mime_type);
+ g_warn_if_reached ();
+ g_free (temp_file);
+ g_free (temp_dir);
+ return;
}
/* copy compressed file to the dest dir */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]