[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 4/n] storage: plug memory leak on error



2010/11/24 Eric Blake <eblake redhat com>:
> * src/storage/storage_backend.c
> (virStorageBackendUpdateVolTargetInfoFD): Avoid leak.
> ---
>
> Unlikely to bite in real life, but still a leak.
>
>  src/storage/storage_backend.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
> index a6ee564..10ea33c 100644
> --- a/src/storage/storage_backend.c
> +++ b/src/storage/storage_backend.c
> @@ -1148,11 +1148,11 @@ virStorageBackendUpdateVolTargetInfoFD(virStorageVolTargetPtr target,
>         }
>     } else {
>         target->perms.label = strdup(filecon);
> +        freecon(filecon);
>         if (target->perms.label == NULL) {
>             virReportOOMError();
>             return -1;
>         }
> -        freecon(filecon);
>     }
>  #else
>     target->perms.label = NULL;
> --
> 1.7.3.2
>

ACK.

Matthias


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]