[libvirt] [PATCH 05/14] locking: Resolve resource leak with 'dir' on non error path

Ján Tomko jtomko at redhat.com
Tue Jan 15 13:03:51 UTC 2013


On 01/09/13 15:54, John Ferlan wrote:
> ---
>  src/locking/lock_driver_sanlock.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c
> index d06fa66..df6bee9 100644
> --- a/src/locking/lock_driver_sanlock.c
> +++ b/src/locking/lock_driver_sanlock.c
> @@ -235,6 +235,7 @@ static int virLockManagerSanlockSetupLockspace(void)
>                             path);
>              goto error;
>          }
> +        VIR_FREE(dir);
>  
>          if (driver->group != (gid_t) -1)
>              perms |= 0060;

That does fix the 'dir' leak, but it seems we still leak 'path' on
non-error path this way.




More information about the libvir-list mailing list