From 6af62610eedd446a29f94508cde1e4409b593505 Mon Sep 17 00:00:00 2001
From: Vit Rosin <vit_r@list.ru>
Date: Tue, 16 Mar 2010 21:59:29 +0000
Subject: [PATCH] lib/vfs/mc-vfs/fish.c src/editor/edit.c missing g_free
---
lib/vfs/mc-vfs/fish.c | 3 ++-
src/editor/edit.c | 13 +++++++++++--
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/lib/vfs/mc-vfs/fish.c b/lib/vfs/mc-vfs/fish.c
index 317ece2..b9e32e7 100644
a
|
b
|
fish_linear_start (struct vfs_class *me, struct vfs_s_fh *fh, off_t offset) |
821 | 821 | name = vfs_s_fullpath (me, fh->ino); |
822 | 822 | if (!name) |
823 | 823 | return 0; |
824 | | quoted_name = strutils_shell_escape(name); |
| 824 | quoted_name = strutils_shell_escape (name); |
| 825 | g_free (name); |
825 | 826 | fh->u.fish.append = 0; |
826 | 827 | |
827 | 828 | /* |
diff --git a/src/editor/edit.c b/src/editor/edit.c
index b88e294..1d0408c 100644
a
|
b
|
int edit_get_utf (WEdit * edit, long byte_index, int *char_width) |
208 | 208 | width = 0; |
209 | 209 | } |
210 | 210 | } |
| 211 | g_free (str); |
211 | 212 | *char_width = width; |
212 | 213 | return ch; |
213 | 214 | } |
… |
… |
int edit_get_prev_utf (WEdit * edit, long byte_index, int *char_width) |
236 | 237 | } |
237 | 238 | |
238 | 239 | str = edit_get_byte_ptr (edit, byte_index); |
239 | | buf = edit_get_buf_ptr (edit, byte_index); |
240 | | if (str == NULL || buf == NULL) { |
| 240 | if (str == NULL) { |
241 | 241 | *char_width = 0; |
242 | 242 | return 0; |
243 | 243 | } |
| 244 | buf = edit_get_buf_ptr (edit, byte_index); |
| 245 | if (buf == NULL) { |
| 246 | g_free (str); |
| 247 | *char_width = 0; |
| 248 | return 0; |
| 249 | } |
244 | 250 | /* get prev utf8 char */ |
245 | 251 | if (str != buf) |
246 | 252 | str = g_utf8_find_prev_char (buf, str); |
247 | 253 | |
| 254 | g_free (buf); |
| 255 | |
248 | 256 | res = g_utf8_get_char_validated (str, -1); |
249 | 257 | |
250 | 258 | if (res < 0) { |
… |
… |
int edit_get_prev_utf (WEdit * edit, long byte_index, int *char_width) |
261 | 269 | width = 0; |
262 | 270 | } |
263 | 271 | } |
| 272 | g_free (str); |
264 | 273 | *char_width = width; |
265 | 274 | return ch; |
266 | 275 | } |