[PATCH 09/10] Implement some functions for win32

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for the review

2011/1/11 Colin Guthrie <gmane at colin.guthr.ie>:
> 'Twas brillig, and Maarten Bosmans at 06/01/11 01:39 did gyre and gimble:
>> @@ -2565,7 +2569,11 @@ void pa_unset_env_recorded(void) {
>> ? ? ? ? ?if (!s)
>> ? ? ? ? ? ? ?break;
>>
>> +#ifdef OS_IS_WIN32
>> + ? ? ? ?putenv(pa_sprintf_malloc("%s=", s));
>> +#else
>> ? ? ? ? ?unsetenv(s);
>> +#endif
>> ? ? ? ? ?pa_xfree(s);
>> ? ? ?}
>> ?}
>
>
> This looks leaky....

Yes, I thought so to, but I'm not really that proficient in C (getting
there though). The pa_sprintf_malloc I just copied from the pa_set_env
definition, a couple of lines earlier in core-util.c:


void pa_set_env(const char *key, const char *value) {
    pa_assert(key);
    pa_assert(value);

    /* This is not thread-safe */

    putenv(pa_sprintf_malloc("%s=%s", key, value));
}


Is that wrong to? What fix would you suggest?

Maarten



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux