about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/command/cmd_ac.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c
index 6bab07ce..f60619a3 100644
--- a/src/command/cmd_ac.c
+++ b/src/command/cmd_ac.c
@@ -3002,18 +3002,26 @@ _complete_filepath(const char *const input, char *const startstr)
                 char * acstring;
                 if (output_off) {
                     if (asprintf(&tmp, "%s/%s", directory, dir->d_name) == -1) {
+                        free(foofile);
+                        free(directory);
                         return NULL;
                     }
                     if (asprintf(&acstring, "~/%s", tmp+output_off) == -1) {
+                        free(foofile);
+                        free(directory);
                         return NULL;
                     }
                     free(tmp);
                 } else if (strcmp(directory, "/") == 0) {
                     if (asprintf(&acstring, "/%s", dir->d_name) == -1) {
+                        free(foofile);
+                        free(directory);
                         return NULL;
                     }
                 } else {
                     if (asprintf(&acstring, "%s/%s", directory, dir->d_name) == -1) {
+                        free(foofile);
+                        free(directory);
                         return NULL;
                     }
                 }
@@ -3022,10 +3030,9 @@ _complete_filepath(const char *const input, char *const startstr)
             }
             closedir(d);
         }
-    } else {
-        free(foofile);
-        free(directory);
     }
+    free(foofile);
+    free(directory);
 
     result = autocomplete_param_with_ac(input, startstr, filepath_ac, TRUE);
     if (result) {
pre>
0f88481e ^
f61041c1 ^
7352a91b ^
f61041c1 ^
a2a1ab1e ^
45f1aadc ^
383b3f2d ^
45f1aadc ^
f61041c1 ^
45f1aadc ^





d1349dd6 ^
50f9f94b ^
45f1aadc ^
45f1aadc ^



d1349dd6 ^
50f9f94b ^
45f1aadc ^
50f9f94b ^
383b3f2d ^
45f1aadc ^
d1349dd6 ^

45f1aadc ^

a667eb0b ^
7352a91b ^
45f1aadc ^


a667eb0b ^
45f1aadc ^
d1349dd6 ^


0f88481e ^
d1349dd6 ^

7352a91b ^
d1349dd6 ^


a2a1ab1e ^




d1349dd6 ^
a2a1ab1e ^






45f1aadc ^
a2a1ab1e ^

























45f1aadc ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111