1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-10 12:40:58 +02:00

25656: free val only after it may be passed to strlen().

This commit is contained in:
Clint Adams 2008-09-13 08:19:17 +00:00
parent 2b5ecaf476
commit 6b68cc95c7
2 changed files with 4 additions and 1 deletions

View file

@ -1,5 +1,8 @@
2008-09-13 Clint Adams <clint@zsh.org>
* 25656: Src/params.c: free val only after it may be passed to
strlen().
* 25655: Completion/Unix/Command/_rsync: remove completion for
--remove-sent-files option.

View file

@ -2235,10 +2235,10 @@ setstrvalue(Value v, char *val)
case PM_INTEGER:
if (val) {
v->pm->gsu.i->setfn(v->pm, mathevali(val));
zsfree(val);
if ((v->pm->node.flags & (PM_LEFT | PM_RIGHT_B | PM_RIGHT_Z)) &&
!v->pm->width)
v->pm->width = strlen(val);
zsfree(val);
}
if (!v->pm->base && lastbase != -1)
v->pm->base = lastbase;