~vorlon/compiz/lp.763148

« back to all changes in this revision

Viewing changes to compizconfig/libcompizconfig/src/main.c

Hopefully fixed all memory leaks in libcompizconfig.
Minor whitespace fixes.

(LP: #1076297). Fixes: https://bugs.launchpad.net/bugs/1076297.

Approved by PS Jenkins bot, Sam Spilsbury.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4376
4376
    CCSContextPrivate *cPrivate = GET_PRIVATE (CCSContextPrivate, context);
4377
4377
 
4378
4378
    if (asprintf (&keyName, "+s%d_%s", cPrivate->screenNum, ccsSettingGetName (setting)) == -1)
 
4379
    {
 
4380
        free (sectionName);
4379
4381
        return FALSE;
 
4382
    }
4380
4383
 
4381
4384
    if (ccsIniGetString (dict, sectionName, keyName, &iniValue))
4382
4385
    {
4383
4386
        CCSSetting *newSetting = malloc (sizeof (CCSSetting));
4384
4387
 
4385
4388
        if (!newSetting)
 
4389
        {
 
4390
            free (sectionName);
 
4391
            free (keyName);
 
4392
            free (iniValue);
4386
4393
            return FALSE;
 
4394
        }
4387
4395
 
4388
4396
        ccsObjectInit (newSetting, &ccsDefaultObjectAllocator);
4389
4397
 
4484
4492
            }
4485
4493
            case TypeAction:
4486
4494
            default:
4487
 
                /* FIXME: cleanup */
 
4495
            {
 
4496
                free (newSetting);
 
4497
                free (sectionName);
 
4498
                free (keyName);
 
4499
                free (iniValue);
4488
4500
                return FALSE;
 
4501
            }
4489
4502
        }
4490
4503
 
4491
4504
        CCSSettingList listIter = upgrade->clearValueSettings;
4514
4527
        
4515
4528
        return TRUE;
4516
4529
    }
4517
 
    
 
4530
 
4518
4531
    free (keyName);
4519
4532
    free (sectionName);
4520
 
    
 
4533
    free (iniValue);
 
4534
 
4521
4535
    return FALSE;
4522
4536
}
4523
4537
 
4534
4548
    CCSContextPrivate *cPrivate = GET_PRIVATE (CCSContextPrivate, context);
4535
4549
 
4536
4550
    if (asprintf (&keyName, "-s%d_%s", cPrivate->screenNum, ccsSettingGetName (setting)) == -1)
 
4551
    {
 
4552
        free (sectionName);
4537
4553
        return FALSE;
 
4554
    }
4538
4555
 
4539
4556
    if (ccsIniGetString (dict, sectionName, keyName, &iniValue))
4540
4557
    {
4541
4558
        CCSSetting *newSetting = malloc (sizeof (CCSSetting));
4542
4559
 
4543
4560
        if (!newSetting)
 
4561
        {
 
4562
            free (sectionName);
 
4563
            free (keyName);
 
4564
            free (iniValue);
4544
4565
            return FALSE;
 
4566
        }
4545
4567
 
4546
4568
        ccsObjectInit (newSetting, &ccsDefaultObjectAllocator);
4547
4569
 
4642
4664
            }
4643
4665
            case TypeAction:
4644
4666
            default:
4645
 
                /* FIXME: cleanup */
 
4667
            {
 
4668
                free (newSetting);
 
4669
                free (sectionName);
 
4670
                free (keyName);
 
4671
                free (iniValue);
4646
4672
                return FALSE;
 
4673
            }
4647
4674
        }
4648
4675
 
4649
4676
        CCSSettingList listIter = upgrade->addValueSettings;
4675
4702
    
4676
4703
    free (keyName);
4677
4704
    free (sectionName);
 
4705
    free (iniValue);
4678
4706
 
4679
4707
    return FALSE;
4680
4708
}