Revision 1eec614b savevm.c

b/savevm.c
214 214
    }
215 215

  
216 216
    s = qemu_mallocz(sizeof(QEMUFilePopen));
217
    if (!s) {
218
        fprintf(stderr, "qemu_popen: malloc failed\n");
219
        return NULL;
220
    }
221 217

  
222 218
    s->popen_file = popen_file;
223 219

  
......
246 242
{
247 243
    QEMUFileSocket *s = qemu_mallocz(sizeof(QEMUFileSocket));
248 244

  
249
    if (s == NULL)
250
        return NULL;
251

  
252 245
    s->fd = fd;
253 246
    s->file = qemu_fopen_ops(s, NULL, socket_get_buffer, socket_close, NULL);
254 247
    return s->file;
......
288 281
    QEMUFileStdio *s;
289 282

  
290 283
    s = qemu_mallocz(sizeof(QEMUFileStdio));
291
    if (!s)
292
        return NULL;
293 284

  
294 285
    s->outfile = fopen(filename, mode);
295 286
    if (!s->outfile)
......
339 330
    QEMUFileBdrv *s;
340 331

  
341 332
    s = qemu_mallocz(sizeof(QEMUFileBdrv));
342
    if (!s)
343
        return NULL;
344 333

  
345 334
    s->bs = bs;
346 335
    s->base_offset = offset;
......
359 348
    QEMUFile *f;
360 349

  
361 350
    f = qemu_mallocz(sizeof(QEMUFile));
362
    if (!f)
363
        return NULL;
364 351

  
365 352
    f->opaque = opaque;
366 353
    f->put_buffer = put_buffer;
......
615 602
    static int global_section_id;
616 603

  
617 604
    se = qemu_malloc(sizeof(SaveStateEntry));
618
    if (!se)
619
        return -1;
620 605
    pstrcpy(se->idstr, sizeof(se->idstr), idstr);
621 606
    se->instance_id = (instance_id == -1) ? 0 : instance_id;
622 607
    se->version_id = version_id;
......
908 893

  
909 894
            /* Add entry */
910 895
            le = qemu_mallocz(sizeof(*le));
911
            if (le == NULL) {
912
                ret = -ENOMEM;
913
                goto out;
914
            }
915 896

  
916 897
            le->se = se;
917 898
            le->section_id = section_id;

Also available in: Unified diff