Revision d6771bfa

b/qemu-img.c
577 577
    BlockDriverState **bs, *out_bs;
578 578
    int64_t total_sectors, nb_sectors, sector_num, bs_offset;
579 579
    uint64_t bs_sectors;
580
    uint8_t buf[IO_BUF_SIZE];
580
    uint8_t * buf;
581 581
    const uint8_t *buf1;
582 582
    BlockDriverInfo bdi;
583 583
    QEMUOptionParameter *param = NULL;
......
696 696
    bs_i = 0;
697 697
    bs_offset = 0;
698 698
    bdrv_get_geometry(bs[0], &bs_sectors);
699
    buf = qemu_malloc(IO_BUF_SIZE);
699 700

  
700 701
    if (flags & BLOCK_FLAG_COMPRESS) {
701 702
        if (bdrv_get_info(out_bs, &bdi) < 0)
......
828 829
            }
829 830
        }
830 831
    }
832
    qemu_free(buf);
831 833
    bdrv_delete(out_bs);
832 834
    for (bs_i = 0; bs_i < bs_n; bs_i++)
833 835
        bdrv_delete(bs[bs_i]);
......
1184 1186
        uint64_t num_sectors;
1185 1187
        uint64_t sector;
1186 1188
        int n, n1;
1187
        uint8_t buf_old[IO_BUF_SIZE];
1188
        uint8_t buf_new[IO_BUF_SIZE];
1189
        uint8_t * buf_old;
1190
        uint8_t * buf_new;
1191

  
1192
        buf_old = qemu_malloc(IO_BUF_SIZE);
1193
        buf_new = qemu_malloc(IO_BUF_SIZE);
1189 1194

  
1190 1195
        bdrv_get_geometry(bs, &num_sectors);
1191 1196

  
......
1232 1237
                written += pnum;
1233 1238
            }
1234 1239
        }
1240

  
1241
        qemu_free(buf_old);
1242
        qemu_free(buf_new);
1235 1243
    }
1236 1244

  
1237 1245
    /*

Also available in: Unified diff