zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: another leak found by coverity, this one in _values
@ 2018-04-05 17:09 Oliver Kiddle
  0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2018-04-05 17:09 UTC (permalink / raw)
  To: Zsh workers

This is in the error handling paths for _values if an exclusion list was
successfully parsed but later errors occur when parsing the specs.

Oliver

diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index 2e86e5740..5526e0ad0 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -3022,6 +3022,7 @@ parse_cvdef(char *nam, char **args)
 
 	if (hassep && !sep && name + bs + 1 < p) {
 	    freecvdef(ret);
+	    if (xor) freearray(xor);
 	    zwarnnam(nam, "no multi-letter values with empty separator allowed");
 	    return NULL;
 	}
@@ -3035,6 +3036,7 @@ parse_cvdef(char *nam, char **args)
 
 	    if (!*p) {
 		freecvdef(ret);
+		if (xor) freearray(xor);
 		zwarnnam(nam, "invalid value definition: %s", *args);
 		return NULL;
 	    }
@@ -3046,6 +3048,7 @@ parse_cvdef(char *nam, char **args)
 	}
 	if (c && c != ':') {
 	    freecvdef(ret);
+	    if (xor) freearray(xor);
 	    zwarnnam(nam, "invalid value definition: %s", *args);
 	    return NULL;
 	}
@@ -3054,6 +3057,7 @@ parse_cvdef(char *nam, char **args)
 	if (c == ':') {
 	    if (hassep && !sep) {
 		freecvdef(ret);
+		if (xor) freearray(xor);
 		zwarnnam(nam, "no value with argument with empty separator allowed");
 		return NULL;
 	    }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-06 13:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-05 17:09 PATCH: another leak found by coverity, this one in _values Oliver Kiddle

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).