Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH 12/17: typeset: fix leak of oldval



Found by Coverity (Issue 1255803).
---
 Src/builtin.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Src/builtin.c b/Src/builtin.c
index ae7f53b..38d34ae 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -2510,6 +2510,8 @@ bin_typeset(char *name, char **argv, Options ops, int func)
 							  asg->name),
 				 func, (on | PM_ARRAY) & ~PM_EXPORTED,
 				 off, roff, asg->value, NULL, ops, 0))) {
+	    if (oldval)
+		zsfree(oldval);
 	    unqueue_signals();
 	    return 1;
 	}
-- 
2.2.0.GIT



Messages sorted by: Reverse Date, Date, Thread, Author