Browse Source

Fixed possible memory leak while parameters validation.

Thanks to Peter Kosyh for the bug report.
Serj Kalichev 4 months ago
parent
commit
4b67c31bf8
1 changed files with 3 additions and 1 deletions
  1. 3 1
      klish/ksession/ksession_parse.c

+ 3 - 1
klish/ksession/ksession_parse.c

@@ -53,8 +53,10 @@ static bool_t ksession_validate_arg(ksession_t *session, kpargv_t *pargv)
 		return BOOL_FALSE;
 	}
 
-	if (retcode != 0)
+	if (retcode != 0) {
+		faux_str_free(out);
 		return BOOL_FALSE;
+	}
 
 	if (!faux_str_is_empty(out))
 		kparg_set_value(candidate, out);