Skip to content

Commit dbcd5b9

Browse files
committed
Sound: fix a memleak
1 parent 8982b86 commit dbcd5b9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/detection/sound/sound_linux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ static void paSinkInfoCallback(pa_context *c, const pa_sink_info *i, int eol, vo
1313

1414
FFSoundDevice* device = ffListAdd(userdata);
1515
ffStrbufInitS(&device->identifier, i->name);
16-
ffStrbufInitS(&device->platformApi, "PulseAudio");
16+
ffStrbufInitStatic(&device->platformApi, "PulseAudio");
1717
ffStrbufTrimRightSpace(&device->identifier);
1818
ffStrbufInitS(&device->name, i->description);
1919
ffStrbufTrimRightSpace(&device->name);

src/modules/sound/sound.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ void ffPrintSound(FFSoundOptions* options)
105105
{
106106
ffStrbufDestroy(&device->identifier);
107107
ffStrbufDestroy(&device->name);
108+
ffStrbufDestroy(&device->platformApi);
108109
}
109110
}
110111

@@ -226,6 +227,7 @@ void ffGenerateSoundJsonResult(FF_MAYBE_UNUSED FFSoundOptions* options, yyjson_m
226227
{
227228
ffStrbufDestroy(&device->identifier);
228229
ffStrbufDestroy(&device->name);
230+
ffStrbufDestroy(&device->platformApi);
229231
}
230232
}
231233

0 commit comments

Comments
 (0)