[libvirt] [PATCH 05/11] parallels: Need to free memory on error path

Osier Yang jyang at redhat.com
Thu Jan 31 11:04:30 UTC 2013


On 2013年01月31日 03:36, John Ferlan wrote:
> ---
>   src/parallels/parallels_utils.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/parallels/parallels_utils.c b/src/parallels/parallels_utils.c
> index 171f5d0..0b589ab 100644
> --- a/src/parallels/parallels_utils.c
> +++ b/src/parallels/parallels_utils.c
> @@ -135,8 +135,10 @@ parallelsAddFileExt(const char *path, const char *ext)
>           return NULL;
>       }
>
> -    if (!virStrcpy(new_path, path, len))
> +    if (!virStrcpy(new_path, path, len)) {
> +        VIR_FREE(new_path);
>           return NULL;
> +    }
>       strcat(new_path, ext);
>
>       return new_path;

ACK.




More information about the libvir-list mailing list