projects
/
gst-aseq-appsrc.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Do not use alloca() in app_init(): the memory is used after the return
[gst-aseq-appsrc.git]
/
gst-aseq-appsrc.c
diff --git
a/gst-aseq-appsrc.c
b/gst-aseq-appsrc.c
index
b4f6c39
..
7d4a885
100644
(file)
--- a/
gst-aseq-appsrc.c
+++ b/
gst-aseq-appsrc.c
@@
-347,7
+347,7
@@
app_init (App * app, char *ports)
}
app->npfds = snd_seq_poll_descriptors_count (app->seq, POLLIN);
}
app->npfds = snd_seq_poll_descriptors_count (app->seq, POLLIN);
- app->pfds =
alloca
(sizeof (*app->pfds) * app->npfds);
+ app->pfds =
malloc
(sizeof (*app->pfds) * app->npfds);
if (app->pfds == NULL) {
ret = -ENOMEM;
goto err_free_buffer;
if (app->pfds == NULL) {
ret = -ENOMEM;
goto err_free_buffer;
@@
-371,9
+371,10
@@
static void
app_finalize (App * app)
{
/* free the resources */
app_finalize (App * app)
{
/* free the resources */
+ free (app->pfds);
free (app->buffer);
free (app->buffer);
- free (app->ports);
snd_midi_event_free (app->parser);
snd_midi_event_free (app->parser);
+ free (app->ports);
snd_seq_close (app->seq);
}
snd_seq_close (app->seq);
}