fix bad memory access if a non-existing entry shall be removed from a pa_idxset by index

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1173 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2006-07-31 21:53:21 +00:00
parent d7ee1bcf75
commit e2e94ca47c

View file

@ -286,6 +286,9 @@ void* pa_idxset_remove_by_index(pa_idxset*s, uint32_t idx) {
if (!(a = array_index(s, idx))) if (!(a = array_index(s, idx)))
return NULL; return NULL;
if (!*a)
return NULL;
data = (*a)->data; data = (*a)->data;
remove_entry(s, *a); remove_entry(s, *a);