Skip to contentSkip to conversation

params_free functions don't work

DISCUSSION GitHub issues - opened 1 participant 1 message Jul 31, 2023 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

alsa-project/alsa-lib issue #341 was opened from imyxh:

The following code segfaults on the call to snd_pcm_hw_params_free on my machine:

```c
#include <alsa/asoundlib.h>
void main() {
	snd_pcm_hw_params_t *params;
	snd_pcm_hw_params_alloca(&params);
	snd_pcm_hw_params_free(params);
}
```

The same goes for s/hw/sw/g. Am I doing something wrong? In more complex examples it seems to fail with munmap_chunk complaining about an invalid pointer, or free complaining about an invalid size.

How are the *_params_free functions meant to be used?

Issue URL : https://github.com/alsa-project/alsa-lib/issues/341
Repository URL: https://github.com/alsa-project/alsa-lib