mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-06-01 21:06:04 +02:00
42605: properly free the vi registers hash
This commit is contained in:
parent
d8753f47bb
commit
8e6c1d8b47
|
@ -1,5 +1,8 @@
|
|||
2018-04-07 Oliver Kiddle <okiddle@yahoo.co.uk>
|
||||
|
||||
* 42605: Src/Modules/mapfile.c, Src/Zle/complete.c,
|
||||
Src/Zle/zle_params.c: properly free the vi registers hash
|
||||
|
||||
* 42601: Src/builtin.c: tidy up code for set -A/+A to not
|
||||
increment a NULL pointer and to be more efficient
|
||||
|
||||
|
|
|
@ -158,7 +158,8 @@ setpmmapfiles(Param pm, HashTable ht)
|
|||
|
||||
setpmmapfile(v.pm, ztrdup(getstrvalue(&v)));
|
||||
}
|
||||
deleteparamtable(ht);
|
||||
if (ht != pm->u.hash)
|
||||
deleteparamtable(ht);
|
||||
}
|
||||
|
||||
/**/
|
||||
|
|
|
@ -1325,7 +1325,8 @@ set_compstate(UNUSED(Param pm), HashTable ht)
|
|||
|
||||
break;
|
||||
}
|
||||
deleteparamtable(ht);
|
||||
if (ht != pm->u.hash)
|
||||
deleteparamtable(ht);
|
||||
}
|
||||
|
||||
/**/
|
||||
|
|
|
@ -124,7 +124,7 @@ static const struct gsu_array killring_gsu =
|
|||
static const struct gsu_scalar register_gsu =
|
||||
{ strgetfn, set_register, unset_register };
|
||||
static const struct gsu_hash registers_gsu =
|
||||
{ hashgetfn, set_registers, zleunsetfn };
|
||||
{ hashgetfn, set_registers, unset_registers };
|
||||
|
||||
/* implementation is in zle_refresh.c */
|
||||
static const struct gsu_array region_highlight_gsu =
|
||||
|
@ -837,7 +837,17 @@ set_registers(UNUSED(Param pm), HashTable ht)
|
|||
|
||||
set_register(v.pm, getstrvalue(&v));
|
||||
}
|
||||
deleteparamtable(ht);
|
||||
if (ht != pm->u.hash)
|
||||
deleteparamtable(ht);
|
||||
}
|
||||
|
||||
/**/
|
||||
static void
|
||||
unset_registers(Param pm, int exp)
|
||||
{
|
||||
stdunsetfn(pm, exp);
|
||||
deletehashtable(pm->u.hash);
|
||||
pm->u.hash = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue