mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
optget: Improve memory leak fix (re: 333a8ca6)
The memory leak only occurred when an \f...\f string was used outside a braces block ('{'...'}' a.k.a. GO...OG). This shows the way to a more correct and elegant fix. Co-authored by: Martijn Dekker <martijn@inlv.org>
This commit is contained in:
parent
b52edb380c
commit
29010761a5
1 changed files with 1 additions and 4 deletions
|
@ -2140,7 +2140,7 @@ textout(Sfio_t* sp, register char* s, char* conform, int conformlen, int style,
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (!*s)
|
||||
else if (*s != OG)
|
||||
{
|
||||
if (!(tsp = psp))
|
||||
break;
|
||||
|
@ -2148,8 +2148,6 @@ textout(Sfio_t* sp, register char* s, char* conform, int conformlen, int style,
|
|||
psp = psp->next;
|
||||
free(tsp);
|
||||
}
|
||||
else if (*s != OG)
|
||||
break;
|
||||
else
|
||||
{
|
||||
s++;
|
||||
|
@ -2157,7 +2155,6 @@ textout(Sfio_t* sp, register char* s, char* conform, int conformlen, int style,
|
|||
break;
|
||||
}
|
||||
}
|
||||
pop(psp);
|
||||
return s;
|
||||
}
|
||||
s++;
|
||||
|
|
Loading…
Reference in a new issue