Introduction
Introduction Statistics Contact Development Disclaimer Help
trset: prevent memory leak in re_read() for bad input - neatvi - [fork] simple …
git clone git://src.adamsgaard.dk/neatvi
Log
Files
Refs
README
---
commit ad905f06084738d3f3a95f0775586ac515312a49
parent fb7b24e9ad8c6d7a9b8a3c9d3e3091a4cd8b4fd4
Author: Kyryl Melekhin <[email protected]>
Date: Sun, 26 Sep 2021 18:17:16 +0330
rset: prevent memory leak in re_read() for bad input
Diffstat:
M rset.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/rset.c b/rset.c
t@@ -130,11 +130,12 @@ void rset_free(struct rset *rs)
/* read a regular expression enclosed in a delimiter */
char *re_read(char **src)
{
- struct sbuf *sbuf = sbuf_make();
+ struct sbuf *sbuf;
char *s = *src;
int delim = (unsigned char) *s++;
if (!delim)
return NULL;
+ sbuf = sbuf_make();
while (*s && *s != delim) {
if (s[0] == '\\' && s[1])
if (*(++s) != delim)
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.