aboutsummaryrefslogtreecommitdiff
path: root/which.c
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-05-07 22:45:06 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-05-07 22:45:06 +0000
commit9c9fc7d1281721d16ca07f7bf6395b0b0239acd7 (patch)
treece3503e19d0561a5556055e10018c1f5d8ed9e2b /which.c
parent44f9c566b3f317e2d22f815c258b78f8a2000539 (diff)
downloadbusybox-w32-9c9fc7d1281721d16ca07f7bf6395b0b0239acd7.tar.gz
busybox-w32-9c9fc7d1281721d16ca07f7bf6395b0b0239acd7.tar.bz2
busybox-w32-9c9fc7d1281721d16ca07f7bf6395b0b0239acd7.zip
A bug fix from Vladimir for a memory leak I stupidly
added to which.c. git-svn-id: svn://busybox.net/trunk/busybox@2561 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to '')
-rw-r--r--which.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/which.c b/which.c
index 1e5e9eed5..b2acd78de 100644
--- a/which.c
+++ b/which.c
@@ -54,8 +54,7 @@ extern int which_main(int argc, char **argv)
54 found = 0; 54 found = 0;
55 for (i = 0; i < count; i++) { 55 for (i = 0; i < count; i++) {
56 char *buf; 56 char *buf;
57 buf = concat_path_file(buf, path_n); 57 buf = concat_path_file(path_n, *argv);
58 buf = concat_path_file(buf, *argv);
59 if (stat (buf, &filestat) == 0 58 if (stat (buf, &filestat) == 0
60 && filestat.st_mode & S_IXUSR) 59 && filestat.st_mode & S_IXUSR)
61 { 60 {
@@ -63,6 +62,7 @@ extern int which_main(int argc, char **argv)
63 found = 1; 62 found = 1;
64 break; 63 break;
65 } 64 }
65 free(buf);
66 path_n += (strlen(path_n) + 1); 66 path_n += (strlen(path_n) + 1);
67 } 67 }
68 if (!found) 68 if (!found)