1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-22 00:21:27 +01:00

183818: memory leak in zle_params.c

This commit is contained in:
Peter Stephenson 2003-03-05 17:24:37 +00:00
parent e0d2c9c0b3
commit 5660eb86ac
2 changed files with 9 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2003-03-05 Peter Stephenson <pws@csr.com>
* 18318: Src/Zle/zle_params.c: memory leak in PREDISPLAY and
POSTDISPLAY when setting zero length values.
2003-02-27 Peter Stephenson <pws@csr.com>
* 18313: Src/Zle/zle_misc.c: After a single yank (hence

View file

@ -482,8 +482,10 @@ set_prepost(unsigned char **textvar, int *lenvar, char *x)
}
if (x) {
unmetafy(x, lenvar);
*textvar = (unsigned char *)zalloc(*lenvar);
memcpy((char *)*textvar, x, *lenvar);
if (*lenvar) {
*textvar = (unsigned char *)zalloc(*lenvar);
memcpy((char *)*textvar, x, *lenvar);
}
free(x);
}
}