Revision 898c257b

b/qemu-option.c
416 416
    char value[256];
417 417
    char *param_delim, *value_delim;
418 418
    char next_delim;
419
    size_t num_options;
420 419

  
421 420
    if (list == NULL) {
422 421
        return NULL;
423 422
    }
424 423

  
425 424
    if (dest == NULL) {
426
        // Count valid options
427
        num_options = count_option_parameters(list);
428

  
429
        // Create a copy of the option list to fill in values
430
        dest = qemu_mallocz((num_options + 1) * sizeof(QEMUOptionParameter));
431
        allocated = dest;
432
        memcpy(dest, list, (num_options + 1) * sizeof(QEMUOptionParameter));
425
        dest = allocated = append_option_parameters(NULL, list);
433 426
    }
434 427

  
435 428
    while (*param) {

Also available in: Unified diff