On 07/04/2014 05:29 AM, Peter Krempa wrote:
> Add a few checks and avoid resolving relative links on networked
> storage.
> ---
>  src/util/virstoragefile.c | 27 +++++++++++++++------------
>  1 file changed, 15 insertions(+), 12 deletions(-)
> 

> +
> +            if (nameIsFile && virStorageSourceIsLocalStorage(chain)) {
> +                if (prev && virStorageSourceIsLocalStorage(prev))
> +                    parentDir = mdir_name(prev->path);
> +                else
> +                    ignore_value(VIR_STRDUP(parentDir, "."));

This reports OOM...

> +
> +                if (!parentDir) {
> +                    virReportOOMError();

...and this does it again.  If you are going to ignore_value, you
probably want VIR_STRDUP_QUIET on the earlier instance.  Otherwise, the
pre-patch code had better control over when to report OOM without doing
it twice.

> +                    goto error;
>                  }
> 
> +
>                  int result = virFileRelLinkPointsTo(parentDir, name,

Spurious newline addition?

ACK with OOM reporting cleaned up.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to