summary refs log tree commit diff
path: root/Src/Zle/computil.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle/computil.c')
-rw-r--r--Src/Zle/computil.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index d7d44f999..2c0e119f9 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -819,8 +819,9 @@ parse_cadef(char *nam, char **args)
 	    if (!multi) {
 		if (!xor) {
 		    xor = (char **) zalloc(2 * sizeof(char *));
-		    xor[1] = NULL;
+		    xor[0] = xor[1] = NULL;
 		}
+                zsfree(xor[xnum]);
 		xor[xnum] = ztrdup(rembslashcolon(name));
 	    }
 	    if (c == ':') {
@@ -1029,7 +1030,7 @@ get_cadef(char *nam, char **args)
     Cadef *p, *min, new;
     int i, na = arrlen(args);
 
-    for (i = MAX_CACACHE, p = cadef_cache, min = NULL; *p && i; p++, i--)
+    for (i = MAX_CACACHE, p = cadef_cache, min = NULL; i && *p; p++, i--)
 	if (*p && na == (*p)->ndefs && arrcmp(args, (*p)->defs)) {
 	    (*p)->lastt = time(0);