Revision 7267c094 block/dmg.c

b/block/dmg.c
127 127

  
128 128
	    chunk_count = (count-204)/40;
129 129
	    new_size = sizeof(uint64_t) * (s->n_chunks + chunk_count);
130
	    s->types = qemu_realloc(s->types, new_size/2);
131
	    s->offsets = qemu_realloc(s->offsets, new_size);
132
	    s->lengths = qemu_realloc(s->lengths, new_size);
133
	    s->sectors = qemu_realloc(s->sectors, new_size);
134
	    s->sectorcounts = qemu_realloc(s->sectorcounts, new_size);
130
	    s->types = g_realloc(s->types, new_size/2);
131
	    s->offsets = g_realloc(s->offsets, new_size);
132
	    s->lengths = g_realloc(s->lengths, new_size);
133
	    s->sectors = g_realloc(s->sectors, new_size);
134
	    s->sectorcounts = g_realloc(s->sectorcounts, new_size);
135 135

  
136 136
	    for(i=s->n_chunks;i<s->n_chunks+chunk_count;i++) {
137 137
		s->types[i] = read_uint32(bs, offset);
......
170 170
    }
171 171

  
172 172
    /* initialize zlib engine */
173
    s->compressed_chunk = qemu_malloc(max_compressed_size+1);
174
    s->uncompressed_chunk = qemu_malloc(512*max_sectors_per_chunk);
173
    s->compressed_chunk = g_malloc(max_compressed_size+1);
174
    s->uncompressed_chunk = g_malloc(512*max_sectors_per_chunk);
175 175
    if(inflateInit(&s->zstream) != Z_OK)
176 176
	goto fail;
177 177

  

Also available in: Unified diff