mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
introspect: Fix two memory issues in port handling code.
First one is a simple typo on an error condition that would have likely caused issues if it ever cropped up. Second issue is that port information is never actually freed if everything works fine.
This commit is contained in:
parent
6fdd5846b2
commit
61fefd67da
1 changed files with 9 additions and 1 deletions
|
|
@ -212,8 +212,8 @@ static void context_get_sink_info_callback(pa_pdispatch *pd, uint32_t command, u
|
|||
pa_tagstruct_getu32(t, &i.ports[0][j].priority) < 0) {
|
||||
|
||||
pa_context_fail(o->context, PA_ERR_PROTOCOL);
|
||||
pa_xfree(i.ports);
|
||||
pa_xfree(i.ports[0]);
|
||||
pa_xfree(i.ports);
|
||||
pa_proplist_free(i.proplist);
|
||||
goto finish;
|
||||
}
|
||||
|
|
@ -250,6 +250,10 @@ static void context_get_sink_info_callback(pa_pdispatch *pd, uint32_t command, u
|
|||
cb(o->context, &i, 0, o->userdata);
|
||||
}
|
||||
|
||||
if (i.ports) {
|
||||
pa_xfree(i.ports[0]);
|
||||
pa_xfree(i.ports);
|
||||
}
|
||||
pa_proplist_free(i.proplist);
|
||||
}
|
||||
}
|
||||
|
|
@ -479,6 +483,10 @@ static void context_get_source_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
cb(o->context, &i, 0, o->userdata);
|
||||
}
|
||||
|
||||
if (i.ports) {
|
||||
pa_xfree(i.ports[0]);
|
||||
pa_xfree(i.ports);
|
||||
}
|
||||
pa_proplist_free(i.proplist);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue