Explorar el Código

Fixed possible memory leak while parameters validation.

Thanks to Peter Kosyh for the bug report.
Serj Kalichev hace 4 meses
padre
commit
4b67c31bf8
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  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);