mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	xfs: fix two memory leaks in xfs_attr_list.c error paths
This plugs 2 trivial leaks in xfs_attr_shortform_list and xfs_attr3_leaf_list_int. Signed-off-by: Mateusz Guzik <mguzik@redhat.com> Cc: <stable@vger.kernel.org> Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
		
							parent
							
								
									36f90b0a2d
								
							
						
					
					
						commit
						2e83b79b2d
					
				
					 1 changed files with 10 additions and 9 deletions
				
			
		|  | @ -202,8 +202,10 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context) | |||
| 					sbp->namelen, | ||||
| 					sbp->valuelen, | ||||
| 					&sbp->name[sbp->namelen]); | ||||
| 		if (error) | ||||
| 		if (error) { | ||||
| 			kmem_free(sbuf); | ||||
| 			return error; | ||||
| 		} | ||||
| 		if (context->seen_enough) | ||||
| 			break; | ||||
| 		cursor->offset++; | ||||
|  | @ -454,14 +456,13 @@ xfs_attr3_leaf_list_int( | |||
| 				args.rmtblkcnt = xfs_attr3_rmt_blocks( | ||||
| 							args.dp->i_mount, valuelen); | ||||
| 				retval = xfs_attr_rmtval_get(&args); | ||||
| 				if (retval) | ||||
| 					return retval; | ||||
| 				retval = context->put_listent(context, | ||||
| 						entry->flags, | ||||
| 						name_rmt->name, | ||||
| 						(int)name_rmt->namelen, | ||||
| 						valuelen, | ||||
| 						args.value); | ||||
| 				if (!retval) | ||||
| 					retval = context->put_listent(context, | ||||
| 							entry->flags, | ||||
| 							name_rmt->name, | ||||
| 							(int)name_rmt->namelen, | ||||
| 							valuelen, | ||||
| 							args.value); | ||||
| 				kmem_free(args.value); | ||||
| 			} else { | ||||
| 				retval = context->put_listent(context, | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Mateusz Guzik
						Mateusz Guzik