awk: fix memory leak (can affect large file processing)

This commit is contained in:
Denis Vlasenko 2007-02-24 17:05:52 +00:00
parent 5276402f2c
commit 629563b5d7

View File

@ -23,7 +23,7 @@
#define VF_USER 0x0200 /* 1 = user input (may be numeric string) */
#define VF_SPECIAL 0x0400 /* 1 = requires extra handling when changed */
#define VF_WALK 0x0800 /* 1 = variable has alloc'd x.walker list */
#define VF_FSTR 0x1000 /* 1 = string points to fstring buffer */
#define VF_FSTR 0x1000 /* 1 = var::string points to fstring buffer */
#define VF_CHILD 0x2000 /* 1 = function arg; x.parent points to source */
#define VF_DIRTY 0x4000 /* 1 = variable was set explicitly */
@ -740,7 +740,7 @@ static var *copyvar(var *dest, const var *src)
{
if (dest != src) {
clrvar(dest);
dest->type |= (src->type & ~VF_DONTTOUCH);
dest->type |= (src->type & ~(VF_DONTTOUCH | VF_FSTR));
dest->number = src->number;
if (src->string)
dest->string = xstrdup(src->string);