From d52b1dced188f6d96ad0e5b4f79cc455e0b19cd2 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Thu, 22 Mar 2012 16:18:36 +0300 Subject: [PATCH] Ticket #2759: Unable to edit gzipped files Steps to reprosuce: *) dmesg| gzip -c9 > out.gz *) press F4 on out.gz file Expected result: editor should be opened Actual result: segmentation fault. Signed-off-by: Slava Zanko --- src/editor/edit.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/editor/edit.c b/src/editor/edit.c index 961588fb5..87791d60a 100644 --- a/src/editor/edit.c +++ b/src/editor/edit.c @@ -2121,7 +2121,6 @@ edit_insert_file (WEdit * edit, const vfs_path_t * filename_vpath) edit_error_dialog (_("Error"), errmsg); g_free (errmsg); ins_len = -1; - goto ret; } } else @@ -2132,7 +2131,6 @@ edit_insert_file (WEdit * edit, const vfs_path_t * filename_vpath) edit_error_dialog (_("Error"), errmsg); g_free (errmsg); ins_len = -1; - goto ret; } g_free (p); } @@ -2145,10 +2143,7 @@ edit_insert_file (WEdit * edit, const vfs_path_t * filename_vpath) file = mc_open (filename_vpath, O_RDONLY | O_BINARY); if (file == -1) - { - ins_len = -1; - goto ret; - } + return -1; buf = g_malloc0 (TEMP_BUF_LEN); blocklen = mc_read (file, buf, sizeof (VERTICAL_MAGIC)); @@ -2202,8 +2197,6 @@ edit_insert_file (WEdit * edit, const vfs_path_t * filename_vpath) ins_len = 0; } - ret: - g_free (p); return ins_len; }