posix_tty: free leak of xf86SetStrOption return value.

Pointed out by coverity.

Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Dave Airlie 2018-09-12 11:05:45 +10:00
parent b6c29a881e
commit cad3a1a82d

View File

@ -188,7 +188,7 @@ xf86SetSerial(int fd, XF86OptionPtr options)
{
struct termios t;
int val;
const char *s;
char *s;
int baud, r;
if (fd < 0)
@ -264,8 +264,10 @@ xf86SetSerial(int fd, XF86OptionPtr options)
}
else {
xf86Msg(X_ERROR, "Invalid Option Parity value: %s\n", s);
free(s);
return -1;
}
free(s);
}
if ((val = xf86SetIntOption(options, "Vmin", -1)) != -1) {
@ -291,8 +293,10 @@ xf86SetSerial(int fd, XF86OptionPtr options)
}
else {
xf86Msg(X_ERROR, "Invalid Option FlowControl value: %s\n", s);
free(s);
return -1;
}
free(s);
}
if ((xf86SetBoolOption(options, "ClearDTR", FALSE))) {