Fix a memory leak in pulseaudio plugin

master
fryshorts 2014-05-19 20:57:49 +02:00
parent ad9d15c838
commit f3d9d248b6
1 changed files with 3 additions and 3 deletions

View File

@ -410,13 +410,13 @@ static void pulse_update(void *vptr, obs_data_t settings)
{
PULSE_DATA(vptr);
bool restart = false;
char *new_device;
const char *new_device;
new_device = bstrdup(obs_data_getstring(settings, "device_id"));
new_device = obs_data_getstring(settings, "device_id");
if (!data->device || strcmp(data->device, new_device) != 0) {
if (data->device)
bfree(data->device);
data->device = new_device;
data->device = bstrdup(new_device);
restart = true;
}