mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +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))
|
if (!(tsp = psp))
|
||||||
break;
|
break;
|
||||||
|
@ -2148,8 +2148,6 @@ textout(Sfio_t* sp, register char* s, char* conform, int conformlen, int style,
|
||||||
psp = psp->next;
|
psp = psp->next;
|
||||||
free(tsp);
|
free(tsp);
|
||||||
}
|
}
|
||||||
else if (*s != OG)
|
|
||||||
break;
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
s++;
|
s++;
|
||||||
|
@ -2157,7 +2155,6 @@ textout(Sfio_t* sp, register char* s, char* conform, int conformlen, int style,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pop(psp);
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
s++;
|
s++;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue