(find_file): minor optimization of memory free.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2015-06-19 17:12:08 +03:00
parent 677b5c4f40
commit c3db552bfc
1 changed files with 10 additions and 20 deletions

View File

@ -1763,27 +1763,22 @@ find_file (void)
{
char *start_dir = NULL, *pattern = NULL, *content = NULL, *ignore_dirs = NULL;
ssize_t start_dir_len;
char *filename = NULL, *dirname = NULL;
while (find_parameters (&start_dir, &start_dir_len, &ignore_dirs, &pattern, &content))
{
int v;
char *filename = NULL, *dirname = NULL;
int v = B_CANCEL;
if (pattern[0] == '\0')
if (pattern[0] != '\0')
{
g_free (start_dir);
g_free (ignore_dirs);
g_free (pattern);
g_free (content);
break; /* nothing search */
last_refresh.tv_sec = 0;
last_refresh.tv_usec = 0;
is_start = FALSE;
v = do_find (start_dir, start_dir_len, ignore_dirs, pattern, content, &dirname,
&filename);
}
last_refresh.tv_sec = 0;
last_refresh.tv_usec = 0;
dirname = filename = NULL;
is_start = FALSE;
v = do_find (start_dir, start_dir_len, ignore_dirs, pattern, content, &dirname, &filename);
g_free (start_dir);
g_free (ignore_dirs);
g_free (pattern);
@ -1810,18 +1805,13 @@ find_file (void)
do_cd (filename_vpath, cd_exact);
vfs_path_free (filename_vpath);
}
g_free (content);
g_free (dirname);
g_free (filename);
break;
}
g_free (content);
g_free (dirname);
g_free (filename);
if (v == B_CANCEL)
if (v == B_ENTER || v == B_CANCEL)
break;
if (v == B_PANELIZE)