mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 10:52:08 +02:00
Sound: always initialize identifier and destroy it to avoid memleaks
This commit is contained in:
+4
-2
@@ -2,7 +2,7 @@
|
||||
#include "detection/sound/sound.h"
|
||||
|
||||
#define FF_SOUND_MODULE_NAME "Sound"
|
||||
#define FF_SOUND_NUM_FORMAT_ARGS 4
|
||||
#define FF_SOUND_NUM_FORMAT_ARGS 5
|
||||
|
||||
static void printDevice(FFinstance* instance, const FFSoundDevice* device, uint8_t index)
|
||||
{
|
||||
@@ -27,7 +27,8 @@ static void printDevice(FFinstance* instance, const FFSoundDevice* device, uint8
|
||||
{FF_FORMAT_ARG_TYPE_BOOL, &device->main},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &device->name},
|
||||
{FF_FORMAT_ARG_TYPE_UINT8, &device->volume},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &device->manufacturer}
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &device->manufacturer},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &device->identifier}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -72,6 +73,7 @@ void ffPrintSound(FFinstance* instance)
|
||||
|
||||
FF_LIST_FOR_EACH(FFSoundDevice, device, result)
|
||||
{
|
||||
ffStrbufDestroy(&device->identifier);
|
||||
ffStrbufDestroy(&device->name);
|
||||
ffStrbufDestroy(&device->manufacturer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user