From f753fb306e19f00b83e0aa2007cd1903311e3b1e Mon Sep 17 00:00:00 2001
From: Vit Rosin <vit_r@list.ru>
Date: Sun, 28 Feb 2010 20:48:12 +0000
Subject: [PATCH] missing mc_config_deinit vfs_s_close g_free
---
lib/mcconfig/common.c | 8 ++++----
lib/skin/colors.c | 8 +++++---
lib/vfs/mc-vfs/direntry.c | 6 +++++-
src/editor/editcmd.c | 9 ++++++++-
4 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/lib/mcconfig/common.c b/lib/mcconfig/common.c
index dd0cb4e..f8fd5f7 100644
a
|
b
|
mc_config_read_file (mc_config_t * mc_config, const gchar * ini_path) |
195 | 195 | gchar **keys, **curr_key; |
196 | 196 | gchar *value; |
197 | 197 | |
198 | | if (mc_config == NULL) { |
| 198 | if (mc_config == NULL) |
199 | 199 | return FALSE; |
200 | | } |
201 | 200 | |
202 | 201 | tmp_config = mc_config_init (ini_path); |
203 | 202 | if (tmp_config == NULL) |
… |
… |
mc_config_read_file (mc_config_t * mc_config, const gchar * ini_path) |
205 | 204 | |
206 | 205 | groups = mc_config_get_groups (tmp_config, NULL); |
207 | 206 | |
208 | | if (groups == NULL) |
| 207 | if (groups == NULL) { |
| 208 | mc_config_deinit (tmp_config); |
209 | 209 | return FALSE; |
210 | | |
| 210 | } |
211 | 211 | for (curr_grp = groups; *curr_grp != NULL; curr_grp++) { |
212 | 212 | keys = mc_config_get_keys (tmp_config, *curr_grp, NULL); |
213 | 213 | for (curr_key = keys; *curr_key != NULL; curr_key++) { |
diff --git a/lib/skin/colors.c b/lib/skin/colors.c
index 22f6c1a..c8c73df 100644
a
|
b
|
mc_skin_color_get_from_ini_file (mc_skin_t * mc_skin, const gchar * group, const |
127 | 127 | |
128 | 128 | values = mc_config_get_string_list (mc_skin->config, group, key, &items_count); |
129 | 129 | |
130 | | if (values == NULL || *values == NULL) { |
131 | | if (values != NULL) |
132 | | g_strfreev (values); |
| 130 | if (values == NULL) |
| 131 | return NULL; |
| 132 | |
| 133 | if (*values == NULL) { |
| 134 | g_strfreev (values); |
133 | 135 | return NULL; |
134 | 136 | } |
135 | 137 | mc_skin_color = g_try_new0 (mc_skin_color_t, 1); |
diff --git a/lib/vfs/mc-vfs/direntry.c b/lib/vfs/mc-vfs/direntry.c
index 83cd050..ef87218 100644
a
|
b
|
vfs_s_getlocalcopy (struct vfs_class *me, const char *path) |
1045 | 1045 | char *local; |
1046 | 1046 | |
1047 | 1047 | fh = vfs_s_open (me, path, O_RDONLY, 0); |
1048 | | if (!fh || !fh->ino || !fh->ino->localname) |
| 1048 | if (fh == NULL) |
1049 | 1049 | return NULL; |
1050 | 1050 | |
| 1051 | if (fh->ino == NULL || fh->ino->localname == NULL) { |
| 1052 | vfs_s_close (fh); |
| 1053 | return NULL; |
| 1054 | } |
1051 | 1055 | local = g_strdup (fh->ino->localname); |
1052 | 1056 | vfs_s_close (fh); |
1053 | 1057 | return local; |
diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c
index 81331e9..dc13f6a 100644
a
|
b
|
edit_search_cmd (WEdit * edit, int again) |
1927 | 1927 | if (search_string && *search_string) |
1928 | 1928 | { |
1929 | 1929 | tmp = str_convert_to_input (search_string); |
| 1930 | |
| 1931 | g_free (search_string); |
| 1932 | search_string = NULL; |
| 1933 | |
1930 | 1934 | if (tmp && tmp->len) |
1931 | 1935 | search_string = tmp->str; |
1932 | 1936 | |
… |
… |
edit_search_cmd (WEdit * edit, int again) |
1959 | 1963 | if (edit->search == NULL) |
1960 | 1964 | { |
1961 | 1965 | edit->search_start = edit->curs1; |
| 1966 | g_free (search_string); |
1962 | 1967 | return; |
1963 | 1968 | } |
1964 | 1969 | edit->search->search_type = edit_search_options.type; |
… |
… |
edit_search_cmd (WEdit * edit, int again) |
1967 | 1972 | edit->search->whole_words = edit_search_options.whole_words; |
1968 | 1973 | edit->search->search_fn = edit_search_cmd_callback; |
1969 | 1974 | } |
1970 | | |
| 1975 | if (search_string) |
| 1976 | g_free (search_string); |
| 1977 | |
1971 | 1978 | if (search_create_bookmark) |
1972 | 1979 | { |
1973 | 1980 | edit_search_cmd_search_create_bookmark (edit); |