On Tue, Feb 11, 2014 at 06:03:39PM +0100, Paolo Bonzini wrote:
> @@ -1349,14 +1350,15 @@ static int iscsi_reopen_prepare(BDRVReopenState 
> *state,
>  static int iscsi_truncate(BlockDriverState *bs, int64_t offset)
>  {
>      IscsiLun *iscsilun = bs->opaque;
> -    int ret = 0;
> +    Error *local_err = NULL;
>  
>      if (iscsilun->type != TYPE_DISK) {
>          return -ENOTSUP;
>      }
>  
> -    if ((ret = iscsi_readcapacity_sync(iscsilun)) != 0) {
> -        return ret;
> +    iscsi_readcapacity_sync(iscsilun, &local_err);
> +    if (local_err != NULL) {
> +        return -EIO;
>      }

Memory leak.  We need to free local_err.

Reply via email to