aboutsummaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
authorFelipe Oliveira Carvalho <felipekde@gmail.com>2014-05-01 15:07:48 -0300
committerJustin M. Keyes <justinkz@gmail.com>2014-05-07 15:52:27 -0400
commit8704a5832b6d70d0ebc3872468beaea0367f4680 (patch)
treee34df96b21b68162f43713c4f37d4540c0fe3ac7 /src/search.c
parent973baa2a06216931747404587461184d83cbdabe (diff)
downloadrneovim-8704a5832b6d70d0ebc3872468beaea0367f4680.tar.gz
rneovim-8704a5832b6d70d0ebc3872468beaea0367f4680.tar.bz2
rneovim-8704a5832b6d70d0ebc3872468beaea0367f4680.zip
Replace lalloc() with xmalloc()
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/search.c b/src/search.c
index 3d153c433c..891db71549 100644
--- a/src/search.c
+++ b/src/search.c
@@ -4195,8 +4195,7 @@ find_pattern_in_path (
if (new_fname != NULL) {
/* Push the new file onto the file stack */
if (depth + 1 == old_files) {
- bigger = (SearchedFile *)lalloc((long_u)(
- max_path_depth * 2 * sizeof(SearchedFile)), TRUE);
+ bigger = xmalloc(max_path_depth * 2 * sizeof(SearchedFile));
for (i = 0; i <= depth; i++)
bigger[i] = files[i];
for (i = depth + 1; i < old_files + max_path_depth; i++) {
@@ -4217,10 +4216,8 @@ find_pattern_in_path (
free(new_fname);
else {
if (++depth == old_files) {
- /*
- * lalloc() for 'bigger' must have failed above. We
- * will forget one of our already visited files now.
- */
+ // Something wrong. We will forget one of our already visited files
+ // now.
free(files[old_files].name);
++old_files;
}