浏览代码

libobs: Fix PROPVARIANT variable has not be freed

The PropVariantClear function frees all elements that can be freed in a given PROPVARIANT structure.
Chensiyy 2 年之前
父节点
当前提交
41e2791f27
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      libobs/audio-monitoring/win32/wasapi-enum-devices.c

+ 1 - 0
libobs/audio-monitoring/win32/wasapi-enum-devices.c

@@ -71,6 +71,7 @@ static bool get_device_info(obs_enum_audio_device_cb cb, void *data,
 	os_wcs_to_utf8(name_var.pwszVal, 0, utf8_name, 512);
 	os_wcs_to_utf8(name_var.pwszVal, 0, utf8_name, 512);
 
 
 	cont = cb(data, utf8_name, utf8_id);
 	cont = cb(data, utf8_name, utf8_id);
+	PropVariantClear(&name_var);
 
 
 fail:
 fail:
 	safe_release(store);
 	safe_release(store);