xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit 42306a31c1fe88b35a577c24e2e28d7c65a28e2b

Free files variable in vifm_main()
Wasn't detected before function was renamed to vifm_main().
Technically it still wasn't a leak, but might be if there will be
tests for this function.

Found by Coverity.
Author: xaizek
Author date (UTC): 2017-05-25 12:37
Committer name: xaizek
Committer date (UTC): 2017-05-25 12:37
Parent(s): 3186f9594158d64366e728116303c265ea6f7aa2
Signing key: 99DC5E4DB05F6BE2
Tree: ddcd8b22b151e0879dbe793b6db49f78dda99e8f
File Lines added Lines deleted
src/vifm.c 6 0
File src/vifm.c changed (mode: 100644) (index 10ea823a3..caf159f2e)
... ... vifm_main(int argc, char *argv[])
174 174 files = read_stream_lines(stdin, &nfiles, 1, NULL, NULL); files = read_stream_lines(stdin, &nfiles, 1, NULL, NULL);
175 175 if(reopen_term_stdin() != 0) if(reopen_term_stdin() != 0)
176 176 { {
177 free_string_array(files, nfiles);
177 178 return EXIT_FAILURE; return EXIT_FAILURE;
178 179 } }
179 180 } }
 
... ... vifm_main(int argc, char *argv[])
201 202
202 203 if(init_status(&cfg) != 0) if(init_status(&cfg) != 0)
203 204 { {
205 free_string_array(files, nfiles);
206
204 207 puts("Error during session status initialization."); puts("Error during session status initialization.");
205 208 return -1; return -1;
206 209 } }
 
... ... vifm_main(int argc, char *argv[])
256 259 curr_stats.original_stdout = reopen_term_stdout(); curr_stats.original_stdout = reopen_term_stdout();
257 260 if(curr_stats.original_stdout == NULL) if(curr_stats.original_stdout == NULL)
258 261 { {
262 free_string_array(files, nfiles);
259 263 return -1; return -1;
260 264 } }
261 265
262 266 if(!setup_ncurses_interface()) if(!setup_ncurses_interface())
263 267 { {
268 free_string_array(files, nfiles);
264 269 return -1; return -1;
265 270 } }
266 271
 
... ... vifm_main(int argc, char *argv[])
297 302 flist_custom_set(&rwin, "-", dir, files, nfiles); flist_custom_set(&rwin, "-", dir, files, nfiles);
298 303 } }
299 304 } }
305 free_string_array(files, nfiles);
300 306 /* Load colors in any case to load color pairs. */ /* Load colors in any case to load color pairs. */
301 307 cs_load_pairs(); cs_load_pairs();
302 308
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master