posix_tty: free leak of xf86SetStrOption return value.
Pointed out by coverity.
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit cad3a1a82d)
			
			
This commit is contained in:
		
							parent
							
								
									66d36010a3
								
							
						
					
					
						commit
						83ef02839c
					
				| 
						 | 
					@ -188,7 +188,7 @@ xf86SetSerial(int fd, XF86OptionPtr options)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    struct termios t;
 | 
					    struct termios t;
 | 
				
			||||||
    int val;
 | 
					    int val;
 | 
				
			||||||
    const char *s;
 | 
					    char *s;
 | 
				
			||||||
    int baud, r;
 | 
					    int baud, r;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (fd < 0)
 | 
					    if (fd < 0)
 | 
				
			||||||
| 
						 | 
					@ -264,8 +264,10 @@ xf86SetSerial(int fd, XF86OptionPtr options)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else {
 | 
					        else {
 | 
				
			||||||
            xf86Msg(X_ERROR, "Invalid Option Parity value: %s\n", s);
 | 
					            xf86Msg(X_ERROR, "Invalid Option Parity value: %s\n", s);
 | 
				
			||||||
 | 
					            free(s);
 | 
				
			||||||
            return -1;
 | 
					            return -1;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        free(s);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ((val = xf86SetIntOption(options, "Vmin", -1)) != -1) {
 | 
					    if ((val = xf86SetIntOption(options, "Vmin", -1)) != -1) {
 | 
				
			||||||
| 
						 | 
					@ -291,8 +293,10 @@ xf86SetSerial(int fd, XF86OptionPtr options)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else {
 | 
					        else {
 | 
				
			||||||
            xf86Msg(X_ERROR, "Invalid Option FlowControl value: %s\n", s);
 | 
					            xf86Msg(X_ERROR, "Invalid Option FlowControl value: %s\n", s);
 | 
				
			||||||
 | 
					            free(s);
 | 
				
			||||||
            return -1;
 | 
					            return -1;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        free(s);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ((xf86SetBoolOption(options, "ClearDTR", FALSE))) {
 | 
					    if ((xf86SetBoolOption(options, "ClearDTR", FALSE))) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue