Browse Source

Fix a memory leak in pulseaudio plugin

fryshorts 11 years ago
parent
commit
f3d9d248b6
1 changed files with 3 additions and 3 deletions
  1. 3 3
      plugins/linux-pulseaudio/pulse-input.c

+ 3 - 3
plugins/linux-pulseaudio/pulse-input.c

@@ -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;
 	}